Map<Integer, List<Entity>> groupBy = entityList.stream() .collect(Collectors.groupingBy(Entity::getGrouper));
Map<Integer, Entity> entityMap = entityList.stream() .collect(Collectors.toMap(Entity::getKey, entity -> entity));
posted on 2020-05-12 09:32 路过君 阅读(535) 评论(0) 编辑 收藏 举报