mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
IDEA-161198 Migration from Stream API back to for loops
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
public class Main {
|
||||
public static boolean test(List<List<String>> list) {
|
||||
return list.stream().filter(x -> x != null).flatMap(x -> x.stream()).allMat<caret>ch(x -> x.startsWith("a"));
|
||||
}
|
||||
|
||||
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"))));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user