Is it possible for us to implement a HashMap with one key and two values. Just as HashMap?
Please do help me, also by telling (if there is no way) any other way to
Using Java Collectors
// Group employees by department Map> byDept = employees.stream() .collect(Collectors.groupingBy(Employee::getDepartment));
where Department is your key