Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
371 B
3
Indexable
Never
        Company company = CompanyService.resolveTestCompany();

        // 2. Exercise
        List<Computer> selection = company.getEmployees().stream()
                .flatMap(emp -> emp.getComputers().stream())
                .filter(comp -> comp.getBrand().equals("Dell"))
                .collect(Collectors.toList());
        System.out.println(selection.size());