StreamToLoop: unwrap negation and ternary; minor refactoring

This commit is contained in:
Tagir Valeev
2016-12-12 17:27:53 +07:00
parent 38ded66633
commit 810445f21d
9 changed files with 129 additions and 12 deletions
@@ -0,0 +1,17 @@
// "Replace Stream API chain with loop" "true"
import java.util.Arrays;
import java.util.Objects;
public class Main {
boolean test(String[] strings) {
for (String s : strings) {
if (Objects.nonNull(s)) {
if (!s.startsWith("xyz")) {
return true;
}
}
}
return false;
}
}