当前位置:网站首页>取两个集合的交集
取两个集合的交集
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_ 7_ five
- MIT science and technology review article: AgI hype around Gato and other models may make people ignore the really important issues
- kubernetes之创建mysql8
- [solution] package 'XXXX' is not in goroot
- 力扣 459. 重复的子字符串
- Try the tuiroom of Tencent cloud (there is an appointment in the evening, which will be continued...)
- torch. nn. functional. Pad (input, pad, mode= 'constant', value=none) record
- 力扣 1037.有效的回旋镖
- JVM GC垃圾回收简述
- 一. 基础概念
猜你喜欢
微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
力扣 2319. 判断矩阵是否是一个 X 矩阵
Mrs offline data analysis: process OBS data through Flink job
Leetcode force buckle (Sword finger offer 36-39) 36 Binary search tree and bidirectional linked list 37 Serialize binary tree 38 Arrangement of strings 39 Numbers that appear more than half of the tim
About cv2 dnn. Readnetfromonnx (path) reports error during processing node with 3 inputs and 1 outputs [exclusive release]
Openeuler prize catching activities, to participate in?
CIS芯片测试到底怎么测?
Chapter 9 Yunji datacanvas company won the highest honor of the "fifth digital finance innovation competition"!
Opencv learning notes high dynamic range (HDR) imaging
Open source heavy ware! Chapter 9 the open source project of ylarn causal learning of Yunji datacanvas company will be released soon!
随机推荐
How C language determines whether it is a 32-bit system or a 64 bit system
Precautions for cjson memory leakage
Vulnhub's funfox2
第二十章 使用工作队列管理器(三)
The boundary of Bi: what is bi not suitable for? Master data, Martech? How to expand?
Opencv学习笔记 高动态范围 (HDR) 成像
力扣 1790. 仅执行一次字符串交换能否使两个字符串相等
torch.nn.functional.pad(input, pad, mode=‘constant‘, value=None)记录
Oracle 存储过程之遍历
Ways to improve the utilization of openeuler resources 01: Introduction
mock.js从对象数组中任选数据返回一个数组
mysql 的一些重要知识
大厂经典指针笔试题
图扑数字孪生煤矿开采系统,打造采煤“硬实力”
力扣 2319. 判断矩阵是否是一个 X 矩阵
JVM GC垃圾回收简述
CIS芯片测试到底怎么测?
关于cv2.dnn.readNetFromONNX(path)就报ERROR during processing node with 3 inputs and 1 outputs的解决过程【独家发布】
c语言如何判定是32位系统还是64位系统
一. 基础概念