@Test(expected = NoSuchElementException.class) public void testNext_NoSuchElement() { LazyIterator<Integer> lazyIterator = newLazyIterator(1, 2, 3, 4); advance(lazyIterator, 4); lazyIterator.next(); }
@Override public final T next() { if (!hasNext()) { throw new NoSuchElementException(); } state = State.NOT_READY; return next; }
LazyIterator implements Iterator<T> { @Override public final T next() { if (!hasNext()) { throw new NoSuchElementException(); } state = State.NOT_READY; return next; } }
LazyIterator implements Iterator<T> { @Override public final T next() { if (!hasNext()) { throw new NoSuchElementException(); } state = State.NOT_READY; return next; }  }
LazyIterator implements Iterator<T> { @Override public final T next() { if (!hasNext()) { throw new NoSuchElementException(); } state = State.NOT_READY; return next; }  @Override void remove(); @Override final boolean hasNext(); @Override final T next(); }
LazyIterator implements Iterator<T> { @Override public final T next() { if (!hasNext()) { throw new NoSuchElementException(); } state = State.NOT_READY; return next; }  @Override void remove(); @Override final boolean hasNext(); @Override final T next();  }