Skip to content

Commit

Permalink
fix problem build
Browse files Browse the repository at this point in the history
  • Loading branch information
katrienkraska committed Nov 20, 2024
1 parent 533ec45 commit 1ee4490
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/practice/StreamPractice.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ public List<Person> getWorkablePeople(int fromAge, int femaleToAge, int maleToAg

public List<String> getCatsNames(List<Person> 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)
.collect(Collectors.toList());
Expand Down

0 comments on commit 1ee4490

Please sign in to comment.