@Test public void testConvenienceMethodYieldsNewIterator() { assertThat(ReadOnlyIterator.readOnly(this.iterator)).isNotNull(); }
static <T> ReadOnlyIterator<T> readOnly(Iterator<T> iterator) { if (iterator == null) { throw new IllegalArgumentException("Method argument iterator must not be null."); } return new ReadOnlyIterator<>(iterator); }
ReadOnlyIterator implements Iterator<T> { static <T> ReadOnlyIterator<T> readOnly(Iterator<T> iterator) { if (iterator == null) { throw new IllegalArgumentException("Method argument iterator must not be null."); } return new ReadOnlyIterator<>(iterator); } }
ReadOnlyIterator implements Iterator<T> { static <T> ReadOnlyIterator<T> readOnly(Iterator<T> iterator) { if (iterator == null) { throw new IllegalArgumentException("Method argument iterator must not be null."); } return new ReadOnlyIterator<>(iterator); } ReadOnlyIterator(Iterator<T> iterator); }
ReadOnlyIterator implements Iterator<T> { static <T> ReadOnlyIterator<T> readOnly(Iterator<T> iterator) { if (iterator == null) { throw new IllegalArgumentException("Method argument iterator must not be null."); } return new ReadOnlyIterator<>(iterator); } ReadOnlyIterator(Iterator<T> iterator); @Override boolean hasNext(); @Override T next(); @Override void remove(); }
ReadOnlyIterator implements Iterator<T> { static <T> ReadOnlyIterator<T> readOnly(Iterator<T> iterator) { if (iterator == null) { throw new IllegalArgumentException("Method argument iterator must not be null."); } return new ReadOnlyIterator<>(iterator); } ReadOnlyIterator(Iterator<T> iterator); @Override boolean hasNext(); @Override T next(); @Override void remove();  }