public static < T > Stream < T > of ( final T value ) { return new Stream < T > ( ) { @ Override public Iterator < T > iterator ( ) { return new ReadOnlyIterator < T > ( ) { boolean has = true ; @ Override public boolean hasNext ( ) { return has ; } @ Override public T next ( ) { has = false ; return value ; } } ; } } ; }
Returns a stream with just one given element .