[BAEL-2932] Static import of Predicate.not

This commit is contained in:
dupirefr 2019-05-15 08:29:25 +02:00
parent 7f275f9b38
commit f5937a3600
1 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,8 @@ import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import static java.util.function.Predicate.*;
public class FindPeople {
public static void main(String[] args) {
List<Person> people = List.of(
@ -25,7 +27,7 @@ public class FindPeople {
.collect(Collectors.toList());
people.stream()
.filter(Predicate.not(Person::isAdult))
.filter(not(Person::isAdult))
.collect(Collectors.toList());
}
}