Map<String, Item> map =
list.stream().collect(Collectors.toMap(Item::getKey, item -> item));
Map<String,Set<String>> map = list.stream().
collect(Collectors.groupingBy(
Student::getName,
Collectors.mapping(e->getNum(e.getAddr()), Collectors.toSet())
));
System.out.println("Map : "+map);