public static < T > Stream < T > streamOf ( final Iterator < T > iterator ) { return StreamSupport . stream ( ( ( Iterable < T > ) ( ) -> iterator ) . spliterator ( ) , false ) ; }
Converts iterator to a stream .