@Test
public void testCollect2Lists(){
List<String> result = Stream.of(Lists.newArrayList("A", "B", "C"), Lists.newArrayList("A", "B"))
.flatMap(Collection::stream).distinct().collect(Collectors.toList());
log.info(result.toString());
}
java8 合并两个list并去重
最新推荐文章于 2024-06-30 02:07:33 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)