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