digital-garden/notes/Собеседования/Задачи/Задача 7.md
2024-06-13 21:01:37 +03:00

15 lines
462 B
Markdown

---
parents:
- "[[Вопросы для собеседование Java]]"
---
```java
final Stream<Worker> developerStream = workers.stream()
.filter(worker -> Workers.DEVELOPER.equals(worker.getPosition()));
final List<Worker> developers = developerStream
.collect(Collectors.toList());
final List<Worker> twoDevelopers = developerStream
.filter(worker -> worker.getAge() > 30)
.toList();
```