Map<Object,List<Instance>> collect = list.stream().collect(Collectors.groupingBy(t -> t.getRoomName())); 属性值即为Map的key.