CAS documentCAS = mDocument.getCAS();
AnnotationFS mergedAnnotation = documentCAS.createAnnotation(annotations.getFirst().getType(),
annotations.getFirst().getBegin(), annotations.getLast().getEnd());
mDocument.removeAnnotations(annotations.toList());
mDocument.addFeatureStructure(mergedAnnotation);
}
}