mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 05:09:37 +07:00
11 lines
366 B
Java
11 lines
366 B
Java
// "Collapse loop with stream 'count()'" "true-preview"
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.Set;
|
|
|
|
public class Main {
|
|
public void test(List<Set<String>> nested) {
|
|
int count = (int) nested.stream().filter(Objects::nonNull).flatMap(Collection::stream).filter(str -> str.startsWith("xyz")).count();
|
|
}
|
|
} |