Returns a collector that partitions the elements based on the pred function, and performs a reduction operation on the values of each partition using the downstream collector.
The result map always contains mappings for both true and false keys. If a partition has no elements, its value will be obtained from the downstream.create_accumulator and the downstream.finish function applied.
There are no guarantees on the type, mutability, or thread-safety of the returned map.
pred |
a predicate function |
downstream |
a downstream collector |
the collector implementation |