@Test public void lookAhead() { lineSequence.advance(); LineSequence lookAhead = lineSequence.lookAhead(); assertEquals("SECOND", lookAhead.getCurrentLine().getText()); lookAhead.advance(); assertNull(lookAhead.getCurrentLine()); assertEquals("SECOND", lineSequence.getCurrentLine().getText()); }
@Override public LineSequence lookAhead() { return new TransformLineSequence(delegate.lookAhead(), transform); }
TransformLineSequence extends LineSequence { @Override public LineSequence lookAhead() { return new TransformLineSequence(delegate.lookAhead(), transform); } }
TransformLineSequence extends LineSequence { @Override public LineSequence lookAhead() { return new TransformLineSequence(delegate.lookAhead(), transform); } TransformLineSequence(LineSequence delegate, Function<Line, Line> transform); }
TransformLineSequence extends LineSequence { @Override public LineSequence lookAhead() { return new TransformLineSequence(delegate.lookAhead(), transform); } TransformLineSequence(LineSequence delegate, Function<Line, Line> transform); @Override Line getCurrentLine(); @Override Line getNextLine(); @Override void advance(); @Override LineSequence lookAhead(); }
TransformLineSequence extends LineSequence { @Override public LineSequence lookAhead() { return new TransformLineSequence(delegate.lookAhead(), transform); } TransformLineSequence(LineSequence delegate, Function<Line, Line> transform); @Override Line getCurrentLine(); @Override Line getNextLine(); @Override void advance(); @Override LineSequence lookAhead();  }