1 Continuing first article , this time we will write some more useful custom collectors: for grouping by given criteria, sampling input, batching and ..
2 I am not even pretending this task can be parallelized in general, so I’ll leave combiner() unimplemented:
3 I spent quite some time writing this implementation, especially correct finisher() so don’t be frightened.