### Question:
WordnetAnnotator extends JCasAnnotator_ImplBase { @Override public void process(JCas jCas) throws AnalysisEngineProcessException { for (Token t : JCasUtil.select(jCas, Token.class)) { try { if (t.getPos() != null && POS.getPartOfSpeech(t.getPos().charAt(0)) != null) { POS pos = POS.getPartOfSpeech(t.getPos().charAt(0)); List<String> stems = stemmer.findStems(t.getCoveredText(), pos); if (!stems.isEmpty()) { IIndexWord wnWord = dict .getIndexWord(stems.get(0), pos); if (wnWord != null) { WordnetDictTerm wdt = new WordnetDictTerm(jCas, t.getBegin(), t.getEnd()); wdt.setDictCanon(stems.get(0)); wdt.setEntityId(wnWord.getID().toString()); wdt.addToIndexes(); } } } else { for (POS pos : POS.values()) { List<String> stems = stemmer.findStems( t.getCoveredText(), pos); if (!stems.isEmpty()) { IIndexWord wnWord = dict.getIndexWord(stems.get(0), pos); if (wnWord != null) { WordnetDictTerm wdt = new WordnetDictTerm(jCas, t.getBegin(), t.getEnd()); wdt.setDictCanon(stems.get(0)); wdt.setEntityId(wnWord.getID().toString()); wdt.addToIndexes(); } } } } } catch (Throwable tr) { LOG.debug("Wordnet exception while processing >" + t.getCoveredText() + "< [" + t.getBegin() + ":" + t.getEnd() + "] from doc " + getHeaderDocId(jCas)); } } }  @Override void initialize(UimaContext context); @Override void process(JCas jCas); @Override void collectionProcessComplete();  }### Answer:
@Test public void test() throws Exception { JCas jcas = getTokenizedTestCas("rhinoceroses"); AnalysisEngine ae = createEngine(WordnetAnnotator.class); ae.process(jcas); Collection<WordnetDictTerm> w = select(jcas, WordnetDictTerm.class); Prin.t(w); assertEquals(1, w.size()); }