@Test public void iteratorRemove() { LinesIterable iterable = new LinesIterable(LineSequence.create("one"), Predicates.<Line> alwaysTrue()); Iterator<Line> iterator = iterable.iterator(); assertNotNull(iterator); assertTrue(iterator.hasNext()); Line next = iterator.next(); assertNotNull(next); assertEquals("one", next.getText()); assertThrows(UnsupportedOperationException.class, () -> iterator.remove()); }
@Override public Iterator<Line> iterator() { return new LinesIterator(); }
LinesIterable implements Iterable<Line> { @Override public Iterator<Line> iterator() { return new LinesIterator(); } }
LinesIterable implements Iterable<Line> { @Override public Iterator<Line> iterator() { return new LinesIterator(); } LinesIterable(LineSequence lineSequence, Predicate<Line> predicate); }
LinesIterable implements Iterable<Line> { @Override public Iterator<Line> iterator() { return new LinesIterator(); } LinesIterable(LineSequence lineSequence, Predicate<Line> predicate); @Override Iterator<Line> iterator(); }
LinesIterable implements Iterable<Line> { @Override public Iterator<Line> iterator() { return new LinesIterator(); } LinesIterable(LineSequence lineSequence, Predicate<Line> predicate); @Override Iterator<Line> iterator();  }