1 Map<String,Set<String>> map = list.stream().
2 collect(Collectors.groupingBy(
3 Student::getName,
4 Collectors.mapping(e->getNum(e.getAddr()), Collectors.toSet())
5 ));
6
7 System.out.println("Map : "+map);
8