public Stream < T > reverse ( ) { return new Stream < T > ( ) { @ Override public Iterator < T > iterator ( ) { final ArrayList < T > array = ToArrayList . < T > toArrayList ( ) . call ( Stream . this ) ; Collections . reverse ( array ) ; return array . iterator ( ) ; } } ; }
Returns a new stream that contains all items of the current stream in reverse order . The operator creates a list of all items internally .