You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
summary: Compute two aggregations in a single stream pass.
26
+
explanation: Collectors.teeing() sends each element to two downstream collectors and merges the results. This avoids streaming the data twice or using a mutable accumulator.
27
+
whyModernWins:
28
+
- icon: ⚡
29
+
title: Single pass
30
+
desc: Process the stream once instead of twice.
31
+
- icon: 🧩
32
+
title: Composable
33
+
desc: Combine any two collectors with a merger function.
34
+
- icon: 🔒
35
+
title: Immutable result
36
+
desc: Merge into a record or value object directly.
37
+
support:
38
+
state: available
39
+
description: Widely available since JDK 12 (March 2019)
0 commit comments