The reduce function takes an instance of the BiFunction type, which contains the apply function, taking two values and returning a single one. The this operator can be used to combine all items from the upstream into a single value, as follows:
The preceding diagram shows that the upstream contains two values, and the reduce function passes a sum of them to the downstream.