@Test public void copyInto() { List<Integer> result = new ArrayList<Integer>(); FluentIterable.of(iterableA).copyInto(result); List<Integer> expected = IterableUtils.toList(iterableA); assertEquals(expected.size(), result.size()); assertEquals(expected, result); result = new ArrayList<Integer>(); result.add(10); result.add(9); result.add(8); FluentIterable.of(iterableA).copyInto(result); expected = new ArrayList<Integer>(); expected.addAll(Arrays.asList(10, 9, 8)); expected.addAll(IterableUtils.toList(iterableA)); assertEquals(expected.size(), result.size()); assertEquals(expected, result); try { FluentIterable.of(iterableA).copyInto(null); fail("expecting NullPointerException"); } catch (NullPointerException npe) { } }
public void copyInto(final Collection<? super E> collection) { if (collection == null) { throw new NullPointerException("Collection must not be null"); } CollectionUtils.addAll(collection, iterable); }
FluentIterable implements Iterable<E> { public void copyInto(final Collection<? super E> collection) { if (collection == null) { throw new NullPointerException("Collection must not be null"); } CollectionUtils.addAll(collection, iterable); } }
FluentIterable implements Iterable<E> { public void copyInto(final Collection<? super E> collection) { if (collection == null) { throw new NullPointerException("Collection must not be null"); } CollectionUtils.addAll(collection, iterable); } FluentIterable(); private  FluentIterable(final Iterable<E> iterable); }
FluentIterable implements Iterable<E> { public void copyInto(final Collection<? super E> collection) { if (collection == null) { throw new NullPointerException("Collection must not be null"); } CollectionUtils.addAll(collection, iterable); } 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 void copyInto(final Collection<? super E> collection) { if (collection == null) { throw new NullPointerException("Collection must not be null"); } CollectionUtils.addAll(collection, iterable); } 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();  }