@Test public void eval() { List<Integer> listNumbers = new ArrayList<Integer>(); listNumbers.addAll(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); FluentIterable<Integer> iterable = FluentIterable.of(listNumbers).filter(EVEN); FluentIterable<Integer> materialized = iterable.eval(); listNumbers.addAll(Arrays.asList(11, 12, 13, 14, 15, 16, 17, 18, 19, 20)); assertEquals(5, materialized.size()); assertEquals(10, iterable.size()); assertEquals(Arrays.asList(2, 4, 6, 8, 10), materialized.toList()); assertEquals(Arrays.asList(2, 4, 6, 8, 10, 12, 14, 16, 18, 20), iterable.toList()); }
public FluentIterable<E> eval() { return of(toList()); }
FluentIterable implements Iterable<E> { public FluentIterable<E> eval() { return of(toList()); } }
FluentIterable implements Iterable<E> { public FluentIterable<E> eval() { return of(toList()); } FluentIterable(); private  FluentIterable(final Iterable<E> iterable); }
FluentIterable implements Iterable<E> { public FluentIterable<E> eval() { return of(toList()); } FluentIterable(); private  FluentIterable(final Iterable<E> iterable); @SuppressWarnings("unchecked") static FluentIterable<T> empty(); static FluentIterable<T> of(final T singleton); static FluentIterable<T> of(final T... elements); static FluentIterable<T> of(final Iterable<T> iterable); FluentIterable<E> append(final E... elements); FluentIterable<E> append(final Iterable<? extends E> other); FluentIterable<E> collate(final Iterable<? extends E> other); FluentIterable<E> collate(final Iterable<? extends E> other,
                                     final Comparator<? super E> comparator); FluentIterable<E> eval(); FluentIterable<E> filter(final Predicate<? super E> predicate); FluentIterable<E> limit(final long maxSize); FluentIterable<E> loop(); FluentIterable<E> reverse(); FluentIterable<E> skip(final long elementsToSkip); FluentIterable<O> transform(final Transformer<? super E, ? extends O> transformer); FluentIterable<E> unique(); FluentIterable<E> unmodifiable(); FluentIterable<E> zip(final Iterable<? extends E> other); FluentIterable<E> zip(final Iterable<? extends E>... others); @Override Iterator<E> iterator(); Enumeration<E> asEnumeration(); boolean allMatch(final Predicate<? super E> predicate); boolean anyMatch(final Predicate<? super E> predicate); boolean isEmpty(); boolean contains(final Object object); void forEach(final Closure<? super E> closure); E get(final int position); int size(); void copyInto(final Collection<? super E> collection); E[] toArray(final Class<E> arrayClass); List<E> toList(); @Override String toString(); }
FluentIterable implements Iterable<E> { public FluentIterable<E> eval() { return of(toList()); } FluentIterable(); private  FluentIterable(final Iterable<E> iterable); @SuppressWarnings("unchecked") static FluentIterable<T> empty(); static FluentIterable<T> of(final T singleton); static FluentIterable<T> of(final T... elements); static FluentIterable<T> of(final Iterable<T> iterable); FluentIterable<E> append(final E... elements); FluentIterable<E> append(final Iterable<? extends E> other); FluentIterable<E> collate(final Iterable<? extends E> other); FluentIterable<E> collate(final Iterable<? extends E> other,
                                     final Comparator<? super E> comparator); FluentIterable<E> eval(); FluentIterable<E> filter(final Predicate<? super E> predicate); FluentIterable<E> limit(final long maxSize); FluentIterable<E> loop(); FluentIterable<E> reverse(); FluentIterable<E> skip(final long elementsToSkip); FluentIterable<O> transform(final Transformer<? super E, ? extends O> transformer); FluentIterable<E> unique(); FluentIterable<E> unmodifiable(); FluentIterable<E> zip(final Iterable<? extends E> other); FluentIterable<E> zip(final Iterable<? extends E>... others); @Override Iterator<E> iterator(); Enumeration<E> asEnumeration(); boolean allMatch(final Predicate<? super E> predicate); boolean anyMatch(final Predicate<? super E> predicate); boolean isEmpty(); boolean contains(final Object object); void forEach(final Closure<? super E> closure); E get(final int position); int size(); void copyInto(final Collection<? super E> collection); E[] toArray(final Class<E> arrayClass); List<E> toList(); @Override String toString();  }