diff --git a/src/main/java/practice/StreamPractice.java b/src/main/java/practice/StreamPractice.java index f477600ce..f5293eecf 100644 --- a/src/main/java/practice/StreamPractice.java +++ b/src/main/java/practice/StreamPractice.java @@ -84,7 +84,8 @@ public List getWorkablePeople(int fromAge, int femaleToAge, */ public List getCatsNames(List peopleList, int femaleAge) { return peopleList.stream() - .filter(person -> person.getSex() == Person.Sex.WOMAN && person.getAge() >= femaleAge) + .filter(person -> person.getSex() == Person.Sex.WOMAN + && person.getAge() >= femaleAge) .flatMap(person -> person.getCats().stream()) .map(Cat::getName) .toList();