@Test public void iteratorAdvances() { LinesIterable iterable = new LinesIterable(LineSequence.create("one\ntwo"), Predicates.<Line> alwaysTrue()); Iterator<Line> iterator = iterable.iterator(); assertNotNull(iterator); assertTrue(iterator.hasNext()); Line next = iterator.next(); assertNotNull(next); assertEquals("one", next.getText()); Line two = iterator.next(); assertNotNull(two); assertEquals("two", two.getText()); }
@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();  }