Stream examples Part 2 - Reducers
Next to collectors, Streams offer reducers as well. You can consider it as building a result, starting from a partial solution and building on top of that. It is actually comparable to how the result is built up when using recursion. As an example, let’s take the sum of all integers starting from 1 up until n. The trivial solution is 0 for the ‘empty case’, this is the value before you start looping....