mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 03:07:47 +07:00
18 lines
546 B
Java
18 lines
546 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.List;
|
|
|
|
import static java.util.Arrays.asList;
|
|
|
|
public class Main {
|
|
public static void test(List<List<String>> list) {
|
|
if(list.stream().filter(x -> x != null).flatMap(x -> x.stream()).allMat<caret>ch(x -> x.startsWith("a"))) {
|
|
System.out.println("ok");
|
|
}
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(test(asList(asList(), asList("a"), asList("b", "c"))));
|
|
System.out.println(test(asList(asList(), asList("d"), asList("b", "c"))));
|
|
}
|
|
} |