guava/src/com/google/common/collect/FluentIterable.java
public static <E> FluentIterable<E> from(final Iterable<E> iterable) {
    return (iterable instanceof FluentIterable)
        ? (FluentIterable<E>) iterable
        : new FluentIterable<E>(iterable) {
          @Override
          public Iterator<E> iterator() {
            return iterable.iterator();
          }
        };
  }
public static <E> FluentIterable<E> from(final Iterable<E> iterable) {
    return (iterable instanceof FluentIterable)
        ? (FluentIterable<E>) iterable
        : new FluentIterable<E>(iterable) {
          @Override
          public Iterator<E> iterator() {
            return iterable.iterator();
          }
        };
  }
public static < E > FluentIterable < E > from ( final Iterable < E > iterable ) { return ( iterable instanceof FluentIterable ) ? ( FluentIterable < E > ) iterable : new FluentIterable < E > ( iterable ) { @ Override public Iterator < E > iterator ( ) { return iterable . iterator ( ) ; } } ; }
Returns a fluent iterable that wraps {@code iterable}, or {@code iterable} itself if it is
already a {@code FluentIterable}.

<p><b>{@code Stream} equivalent:</b> {@link Collection#stream} if {@code iterable} is a {@link
Collection}; {@link Streams#stream(Iterable)} otherwise.
Returns a fluent iterable that wraps { @code iterable } or { @code iterable } itself if it is already a { @code FluentIterable } .