462 B
462 B
parents | |
---|---|
|
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();