We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e1ff9b6 commit 1a38020Copy full SHA for 1a38020
1 file changed
src/main/java/lambdasinaction/chap4/Reducing.java
@@ -17,5 +17,8 @@ public static void main(String...args){
17
18
int max = numbers.stream().reduce(0, (a, b) -> Integer.max(a, b));
19
System.out.println(max);
20
+
21
+ Optional<Integer> min = numbers.stream().reduce(Integer::min);
22
+ min.ifPresent(v -> System.out.println(v));
23
}
24
0 commit comments