mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
9 lines
241 B
Java
9 lines
241 B
Java
// "Collapse loop with stream 'max()'" "true-preview"
|
|
|
|
import java.util.*;
|
|
|
|
public class Main {
|
|
public void work(int[] ints) {
|
|
int max = Arrays.stream(ints).filter(anInt -> anInt < 10).filter(anInt -> anInt >= 0).max().orElse(0);
|
|
}
|
|
} |