BoolUtils#getNegatedExpressionText: push negation down into || and &&

This commit is contained in:
Tagir Valeev
2017-04-10 16:11:18 +07:00
parent 21a30b344d
commit d0bd812d05
2 changed files with 41 additions and 23 deletions
@@ -8,7 +8,7 @@ public class Main {
}
public long test(List<Person> collection) {
long i = collection.stream().filter(person -> !(person == null || person.getAge() < 10)).mapToLong(Person::getAge).sum();
long i = collection.stream().filter(person -> person != null && person.getAge() >= 10).mapToLong(Person::getAge).sum();
return i;
}
}