@Test public final void shouldBeIterable() { LazyStream<Integer> stream = LazyStream.create(1, INCREMENT_BY_ONE); List<Integer> iterableValues = FluentIterable.from(stream).limit(5).toList(); Assert.assertEquals(Lists.newArrayList(1, 2, 3, 4, 5), iterableValues); }
public static <U> LazyStream<U> create(final U firstElement, final Function<U, U> inductionStep) { return new LazyStream<U>(firstElement, inductionStep); }
LazyStream implements Iterable<T> { public static <U> LazyStream<U> create(final U firstElement, final Function<U, U> inductionStep) { return new LazyStream<U>(firstElement, inductionStep); } }
LazyStream implements Iterable<T> { public static <U> LazyStream<U> create(final U firstElement, final Function<U, U> inductionStep) { return new LazyStream<U>(firstElement, inductionStep); } private  LazyStream(final T head, final Function<T, T> inductionStep); }
LazyStream implements Iterable<T> { public static <U> LazyStream<U> create(final U firstElement, final Function<U, U> inductionStep) { return new LazyStream<U>(firstElement, inductionStep); } private  LazyStream(final T head, final Function<T, T> inductionStep); static LazyStream<U> create(final U firstElement, final Function<U, U> inductionStep); T head(); LazyStream<T> tail(); LazyStream<T> dropWhile(final Predicate<T> predicate); List<T> takeWhile(final Predicate<T> predicate); @Override Iterator<T> iterator(); @Override boolean equals(final Object obj); @Override int hashCode(); }
LazyStream implements Iterable<T> { public static <U> LazyStream<U> create(final U firstElement, final Function<U, U> inductionStep) { return new LazyStream<U>(firstElement, inductionStep); } private  LazyStream(final T head, final Function<T, T> inductionStep); static LazyStream<U> create(final U firstElement, final Function<U, U> inductionStep); T head(); LazyStream<T> tail(); LazyStream<T> dropWhile(final Predicate<T> predicate); List<T> takeWhile(final Predicate<T> predicate); @Override Iterator<T> iterator(); @Override boolean equals(final Object obj); @Override int hashCode();  }