public static <T>CloseableIterator<T> of(final Stream<T> stream){
  return of(stream.iterator(),null);
}

public static < T > CloseableIterator < T > of ( final Stream < T > stream ) { return of ( stream . iterator ( ) , null ) ; }
construct an instance from a stream using stream . close ( ) as the close behavior for the iterator .
