public static <T> Stream<T> create(@SuppressWarnings("unchecked") final T... elements) {
        if (elements.length == 0) {
            return new EmptyStream<T>();
        } else if (elements.length == 1) {
            return new SingletonStream<T>(elements[0]);
        } else {
            return new IteratorStream<T>(Iterators.forArray(elements));
        }
    }
public static < T > Stream < T > create ( @ SuppressWarnings ( "unchecked" ) final T ... elements ) { if ( elements . length == 0 ) { return new EmptyStream < T > ( ) ; } else if ( elements . length == 1 ) { return new SingletonStream < T > ( elements [ 0 ] ) ; } else { return new IteratorStream < T > ( Iterators . forArray ( elements ) ) ; } }
Creates a new Stream for the supplied elements. Use this method without arguments to
produce an <i>empty</i> Stream, or with a single argument to produce a <i>singleton</i>
Stream.

@param elements
the elements to be returned by the Stream, not null
@param <T>
the type of elements
@return a Stream over the supplied elements