Given a Collection how can one make a parallel stream?
Collection.parallelStream();
Given a Stream how can one transform it into a parallel stream and back to a regular stream again.
stream.parallel()
.sequential();
How can you use the reduce function of a Stream to sum all the integers of this Integer stream?
Stream stream = Stream.of(1, 2, 3);
Integer sum = stream.reduce(0, Integer::sum);