digital-garden/notes/Собеседования/Задачи/Задача 7.md

15 lines
462 B
Markdown
Raw Normal View History

2024-06-13 21:01:37 +03:00
---
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();
```