IDEA-161198 Migration from Stream API back to for loops

This commit is contained in:
Tagir Valeev
2016-11-01 15:31:34 +07:00
parent 994b0f84a9
commit 9caa6d5ede
181 changed files with 5276 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
// "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) {
for (List<String> x : list) {
if (x != null) {
for (String s : x) {
if (!s.startsWith("a")) {
return false;
}
}
}
}
return true;
}
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"))));
}
}