@Test public void next() { thrown.expect(NoSuchElementException.class); PeekingIterator<Boolean> it = TrueThenDone.INSTANCE.iterator(); assertThat(it).containsExactly(true); it.next(); }
@Override public final T next() { if (!hasNext()) { throw new NoSuchElementException(); } state = State.NOT_READY; return next; }
PeekingIterator implements Iterator<T> { @Override public final T next() { if (!hasNext()) { throw new NoSuchElementException(); } state = State.NOT_READY; return next; } }
PeekingIterator implements Iterator<T> { @Override public final T next() { if (!hasNext()) { throw new NoSuchElementException(); } state = State.NOT_READY; return next; } protected  PeekingIterator(); }
PeekingIterator implements Iterator<T> { @Override public final T next() { if (!hasNext()) { throw new NoSuchElementException(); } state = State.NOT_READY; return next; } protected  PeekingIterator(); @Override final boolean hasNext(); @Override final T next(); T peek(); @Override void remove(); }
PeekingIterator implements Iterator<T> { @Override public final T next() { if (!hasNext()) { throw new NoSuchElementException(); } state = State.NOT_READY; return next; } protected  PeekingIterator(); @Override final boolean hasNext(); @Override final T next(); T peek(); @Override void remove();  }