SyntaxFix
Write A Post
Hire A Developer
Questions
Using Java Collectors
// Group employees by department Map<Department, List<Employee>> byDept = employees.stream() .collect(Collectors.groupingBy(Employee::getDepartment));
where Department is your key