public static < T > Collection < T > collect ( Iterable < T > stream ) { LinkedList < T > collection = new LinkedList <> ( ) ; for ( T e : stream ) { collection . add ( e ) ; } return collection ; }
Returns a Collections that contains all of the objects from the underlying stream in order