That's because you are saving the document in your annotation generate method. You mustn't modify the document directly or call save(). Instead, for each sequence you just need to add an AnnotationGeneratorResult with
Also, don't worry about the annotations on the sequence, these will be maintained automatically. You don't have to return any annotations from the generate method.