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