From fefcedbdb512a71c73166b0185f1b8e7eec13562 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 6 Dec 2024 03:13:43 +0100 Subject: [PATCH] fixed-5 --- src/main/java/practice/StreamPractice.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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();