List<EmpSupportDto> collect = infoList.stream() .filter(e1 -> infoList.stream() .anyMatch(e2 -> e2 != e1 && e2.getEmpId().equals(e1.getEmpId()))) .collect(Collectors.toList());
用流根据list里面的对象的条件过滤出相同的数据
猜你喜欢
转载自blog.csdn.net/m0_64979027/article/details/131007253
今日推荐
周排行