@Test(expected = NoSuchElementException.class) public void shouldThrowNoSuchElementExceptionOnceGeneratorExhausted() throws Exception { Iterable<Integer> backingValues = iterableWith(1); Generator<Integer> generator = new FiniteGenerator<Integer>(backingValues); generator.next(); generator.next(); }
@Override public T next() { mostRecentElement = iterator.next(); return mostRecentElement; }
FiniteGenerator extends AbstractGenerator<T> { @Override public T next() { mostRecentElement = iterator.next(); return mostRecentElement; } }
FiniteGenerator extends AbstractGenerator<T> { @Override public T next() { mostRecentElement = iterator.next(); return mostRecentElement; } FiniteGenerator(Iterable<? extends T> iterable); }
FiniteGenerator extends AbstractGenerator<T> { @Override public T next() { mostRecentElement = iterator.next(); return mostRecentElement; } FiniteGenerator(Iterable<? extends T> iterable); @Override boolean hasNext(); @Override T next(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }
FiniteGenerator extends AbstractGenerator<T> { @Override public T next() { mostRecentElement = iterator.next(); return mostRecentElement; } FiniteGenerator(Iterable<? extends T> iterable); @Override boolean hasNext(); @Override T next(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }