Map<Long, List<TestBean>> testMap = list.stream().collect(Collectors.groupingBy(TestBean::getId));
java8 按对象集合按照对象某一属值分组
最新推荐文章于 2023-07-31 09:46:08 发布
Map<Long, List<TestBean>> testMap = list.stream().collect(Collectors.groupingBy(TestBean::getId));