mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-28 15:20:54 +07:00
11 lines
349 B
Java
11 lines
349 B
Java
// "Collapse loop with stream 'findFirst()'" "true-preview"
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class Main {
|
|
public void testMap(Map<String, List<String>> map) throws Exception {
|
|
int bigSize = map.values().stream().mapToInt(List::size).filter(size -> size > 10).findFirst().orElse(0);
|
|
System.out.println(bigSize);
|
|
}
|
|
} |