List<ABC> abc 按id分组 Map<Integer, List<ABC>> collect = abc.stream().collect(Collectors.groupingBy(ABC::getId)); for(Map.Entry<Integer, List<ABC>> map:collect.entrySet()) {
map.getKey() 和map.getValue()
}
只取id做新的一个list
List<Integer> collect = abc.stream().map(ABC::getId).collect(Collectors.toList());