Java · Hard · Pro
Collectors.teeing — aggregating two collectors at once?
JavaJava 8+Senior
Collectors.teeing
Collectors.teeing runs two collectors on the same stream elements and merges results with a bi-function—one pass, two aggregations.
- Example: min and max in one collect.