当前位置:网站首页>取两个集合的交集
取两个集合的交集
2022-07-07 18:13:00 【枫林残@】
List<Long> departmentUserNos = departmentVOList.stream().map(UserDepartmentVO::getUserNo).collect(toList());
List<Long> postUserNos = uo.stream().map(UserPostVO::getUserNo).collect(toList());
// 取出交集数据
List<Long> collect = departmentUserNos.stream().filter(postUserNos::contains).collect(toList());
//取差集
departmentUserNos.removeAll(collect )--->集合中剩余的为departmentUserNos独有的
同理:
postUserNos.removeAll(collect ) --->集合中剩余的为postUserNos独有的边栏推荐
猜你喜欢

LeetCode力扣(剑指offer 36-39)36. 二叉搜索树与双向链表37. 序列化二叉树38. 字符串的排列39. 数组中出现次数超过一半的数字

Force buckle 599 Minimum index sum of two lists

写了个 Markdown 命令行小工具,希望能提高园友们发文的效率!
![About cv2 dnn. Readnetfromonnx (path) reports error during processing node with 3 inputs and 1 outputs [exclusive release]](/img/59/33381b8d45401607736f05907ee381.png)
About cv2 dnn. Readnetfromonnx (path) reports error during processing node with 3 inputs and 1 outputs [exclusive release]

School 1 of vulnhub

编译器优化那些事儿(4):归纳变量

有了ST7008, 蓝牙测试完全拿捏住了

使用高斯Redis实现二级索引

国家网信办公布《数据出境安全评估办法》:累计向境外提供10万人信息需申报

ASP. Net learning & ASP's one word
随机推荐
The state cyberspace Office released the measures for data exit security assessment: 100000 information provided overseas needs to be declared
[sword finger offer] sword finger offer II 012 The sum of left and right subarrays is equal
Cuda版本不一致,编译apex报错
Creation of kubernetes mysql8
JVM 类加载机制
力扣 643. 子数组最大平均数 I
一. 基础概念
rk3128投影仪lcd显示四周显示不完整解决
Force buckle 674 Longest continuous increasing sequence
Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse
Traversée des procédures stockées Oracle
How to test CIS chip?
MIT科技评论文章:围绕Gato等模型的AGI炒作可能使人们忽视真正重要的问题
Mongodb由浅入深学习
Force buckle 599 Minimum index sum of two lists
The boundary of Bi: what is bi not suitable for? Master data, Martech? How to expand?
《数字图像处理原理与实践(MATLAB版)》一书之代码Part2[通俗易懂]
Opencv learning notes high dynamic range (HDR) imaging
第二十章 使用工作队列管理器(三)
力扣 459. 重复的子字符串