public static < T > CloseableSpliterator < T > spliterator ( Spliterator < T > spliterator ) { if ( spliterator instanceof CloseableSpliterator ) { return ( CloseableSpliterator < T > ) spliterator ; } return new SpliteratorAsCloseableSpliterator <> ( spliterator ) ; }
Creates a closeable spliterator from the given spliterator that does nothing when close is called .