### Question:
OpenNlpSentenceDetector implements SentenceDetector { @Override public Iterator<Token> iterateTokens(final String text) { final opennlp.tools.util.Span[] spans = model.sentPosDetect(text); return new AbstractIterator<Token>() { int idx = 0; @Override protected Token getNext() throws Finished { if (idx >= spans.length) { throw FINISHED; } opennlp.tools.util.Span span = spans[idx++]; String value = text.substring(span.getStart(), span.getEnd()); return new ImmutableToken(span.getStart(), value); } }; } OpenNlpSentenceDetector(File modelFile); @Override Iterator<Token> iterateTokens(final String text);  }### Answer:
@Test public void testOpenNLPSentenceChunker() throws Exception { File sentenceModel = ResourceHelper.getResourceFile(SENTENCE_MODEL_RESOURCE); SentenceDetector sentenceDetector = new OpenNlpSentenceDetector(sentenceModel); Iterator<Token> sentences = sentenceDetector.iterateTokens(TEXT); assertEquals(0, sentences.next().getStartPosition()); assertEquals(51, sentences.next().getStartPosition()); assertEquals(139, sentences.next().getStartPosition()); assertEquals(206, sentences.next().getStartPosition()); assertEquals(329, sentences.next().getStartPosition()); assertEquals(379, sentences.next().getStartPosition()); assertEquals(595, sentences.next().getStartPosition()); assertEquals(680, sentences.next().getStartPosition()); assertEquals(818, sentences.next().getStartPosition()); assertEquals(894, sentences.next().getStartPosition()); }