StreamToLoop tests grouped

This commit is contained in:
Tagir Valeev
2017-01-27 17:38:37 +07:00
parent babce0b78c
commit fb6ba726e5
307 changed files with 2749 additions and 4686 deletions

View File

@@ -0,0 +1,43 @@
// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true"
import java.util.List;
public class Main {
public long test(List<String> list) {
long count = 0L;
for (String s : list) {
count++;
}
return count;
}
public void testAssign(List<String> list) {
long x = 0L;
for (String s : list) {
x++;
}
System.out.println(x);
}
static class Count {
}
public long testNameConflict(List<Count> count) {
long result = 0L;
for (Count count1 : count) {
result++;
}
return result;
}
public long testNoBlock(List<String> list) {
if(!list.isEmpty()) {
long count = 0L;
for (String s : list) {
count++;
}
return count;
}
return -1;
}
}