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