//The following pipeline uses the Stream.reduce operation to calculate the sum
//of the male members' ages in the collection roster:
Integer totalAgeReduce = roster
(a, b) -> a + b);
The Stream.reduce method is a general-purpose reduction operation.
The reduce operation may take two arguments: identity and accumulator.