jdk18常用方法

jdk1.8获取集合中某个属性值相同的集合:

List<String> repeatMobile = requestList.stream().collect(Collectors.groupingBy(
CustomerOrgEmployeeRequest::getMobile, Collectors.counting())).entrySet().stream().filter(entry -> entry.getValue() >1)
.map(Map.Entry::getKey).collect(Collectors.toList());
posted @ 2022-03-29 15:03  smileMrsW  阅读(74)  评论(1)    收藏  举报