@Test public void canConvertWordTokens() { when(document.sentences()).thenReturn(new Sentence[] {sentence}); DocumentConverter converter = new DocumentConverter(jCas, document); converter.convert(); Collection<WordToken> actual = JCasUtil.select(jCas, WordToken.class); assertEquals(5, actual.size()); Iterator<WordToken> iterator = actual.iterator(); WordToken next = iterator.next(); assertEquals(0, next.getBegin()); assertEquals(4, next.getEnd()); next = iterator.next(); assertEquals(5, next.getBegin()); assertEquals(7, next.getEnd()); next = iterator.next(); assertEquals(8, next.getBegin()); assertEquals(9, next.getEnd()); next = iterator.next(); assertEquals(10, next.getBegin()); assertEquals(14, next.getEnd()); next = iterator.next(); assertEquals(14, next.getBegin()); assertEquals(15, next.getEnd()); }
public void convert() { for (Sentence sentence : document.sentences()) { convert(sentence); } }
DocumentConverter { public void convert() { for (Sentence sentence : document.sentences()) { convert(sentence); } } }
DocumentConverter { public void convert() { for (Sentence sentence : document.sentences()) { convert(sentence); } } DocumentConverter(JCas jCas, Document document); }
DocumentConverter { public void convert() { for (Sentence sentence : document.sentences()) { convert(sentence); } } DocumentConverter(JCas jCas, Document document); void convert(); }
DocumentConverter { public void convert() { for (Sentence sentence : document.sentences()) { convert(sentence); } } DocumentConverter(JCas jCas, Document document); void convert();  }