AbstractEventStream extends opennlp.model.AbstractEventStream { public final boolean hasNext() throws IOException { if (events.hasNext()) { return true; } else { T sample = null; while (!events.hasNext() && (sample = samples.read()) != null) { events = createEvents(sample); } return events.hasNext(); } } AbstractEventStream(ObjectStream<T> samples); final boolean hasNext(); final Event next();  }
@Test public void testEmtpyEventStream() throws IOException { List<RESULT> samples = new ArrayList<RESULT>(); samples.add(RESULT.EMPTY); TestEventStream eventStream = new TestEventStream(new CollectionObjectStream<RESULT>(samples)); assertEquals(false, eventStream.hasNext()); samples.add(RESULT.EMPTY); samples.add(RESULT.EMPTY); eventStream = new TestEventStream(new CollectionObjectStream<RESULT>(samples)); assertEquals(false, eventStream.hasNext()); }