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.
27
+
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.
28
+
whyModernWins:
29
+
- icon: ⚡
30
+
title: Single pass
31
+
desc: Process the stream once instead of twice.
32
+
- icon: 🧩
33
+
title: Composable
34
+
desc: Combine any two collectors with a merger function.
35
+
- icon: 🔒
36
+
title: Immutable result
37
+
desc: Merge into a record or value object directly.
38
+
support:
39
+
state: available
40
+
description: Widely available since JDK 12 (March 2019)
0 commit comments