StreamApiMigration tests reorganized

This commit is contained in:
Tagir Valeev
2018-03-13 11:21:23 +07:00
parent b2d5f75a92
commit 2e6232e029
7 changed files with 22 additions and 34 deletions
@@ -0,0 +1,12 @@
// "Replace with collect" "true"
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class Test {
public static void test(List<String> data) {
List<String> result = data.stream().takeWhile(s -> !s.isEmpty()).collect(Collectors.toList());
System.out.println(result);
}
}
@@ -0,0 +1,17 @@
// "Replace with collect" "false"
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void test(List<String> data) {
List<String> result = new ArrayList<>();
for(String s : da<caret>ta) {
if(s.isEmpty()) {
break;
}
result.add(s);
}
System.out.println(result);
}
}
@@ -0,0 +1,17 @@
// "Replace with collect" "true"
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void test(List<String> data) {
List<String> result = new ArrayList<>();
for(String s : da<caret>ta) {
if(s.isEmpty()) {
break;
}
result.add(s);
}
System.out.println(result);
}
}