### Question:
NamedEntityAnnotator extends Annotator { @Override public Document annotate(String text) { log.trace("Annotating document: " + text); Document doc = DocumentFactory.fromText(text); if(doc.countTokens() == 0) return doc; annotate(doc); return doc; } NamedEntityAnnotator(MentionAnnotator recognize, ArticleIndex search, Encoder disambiguate);  NamedEntityAnnotator(MentionAnnotator recognize, ArticleIndex search); @Override Document annotate(String text); @Override Document annotate(Document doc); @Override void annotate(Collection<Document> docs); ArticleIndex getKnowlegeBase(); void disambiguateMentions(Document doc, Annotation.Source source);  }### Answer:
@Test public void test() { Document doc = ann.annotate(text); System.out.println(String.format("Document [%s]: \"%s\"", doc.getLanguage(), doc.getText())); doc.streamAnnotations(Annotation.Source.PRED, MentionAnnotation.class).forEach(ann -> { System.out.println(String.format("-- %s [%s]\t%s", ann.getText(), ann.getType(), ann.getConfidence())); }); doc.streamAnnotations(Annotation.Source.PRED, NamedEntityAnnotation.class).forEach(ann -> { System.out.println(String.format("++ %s [%s]\t%s", ann.getText(), ann.getRefId(), ann.getConfidence())); }); }