当前位置:网站首页>Get the difference data of two sets
Get the difference data of two sets
2022-07-28 02:21:00 【ekkcole】
It can be used to remove inconsistent data between the database and the comparison set
public class TestList {
public static void main(String[] args) {
// browser
List<String> list = Arrays.asList( "2", "3", "4", "5");
// database
List<String> list1 = Arrays.asList("1", "2", "4", "5", "7");
List<String> list2 =new ArrayList<>();
List<String> list3 =new ArrayList<>();
// list1 Not found in
list2=list.stream().filter(e -> {
return !list1.contains(e);
}).collect(Collectors.toList());
// list Not found in
list3=list1.stream().filter(e -> {
return !list.contains(e);
}).collect(Collectors.toList());
System.out.println(list2);
System.out.println(list3);
}
}
边栏推荐
- Product interpretation - Design and distributed expansion of metersphere UI test module
- C # using ABP warehouse to access the database error record set
- Appium 点击操作梳理
- 执行 Add-Migration 迁移时报 Build failed.
- Talk to ye Yanxiu, an atlassian certification expert: where should Chinese users go when atlassian products enter the post server era?
- Day6 函数和模块的使用
- Implementation of mongodb/mongotemplate.upsert batch inserting update data
- 了解加密行业的“下一个大趋势”——Ventures DAO
- 埃睿迪再度亮相数字中国峰会 持续深化用科技守护绿水青山
- synchronized详解
猜你喜欢

Behind every piece of information you collect, you can't live without TA

53:第五章:开发admin管理服务:6:开发【admin管理员退出登录,接口】;(一个点:我们想要修改一个采用了某种编码方式的值时,新的值最好也按照这种编码方式编码后,再去修改;)

清除浮动的原因和六种方法(解决浮动飞起影响父元素和全局的问题)

Huawei app UI automation test post interview real questions, real interview experience.

Two ways for wechat applet to realize dynamic horizontal step bar

11-Django-基础篇-数据库操作

小米网站主页面大模块——小模块+导航(浮动案例)

【愚公系列】2022年07月 Go教学课程 019-循环结构之for
![[机缘参悟-53]:阳谋立身,阴谋防身](/img/93/2f61993770d93d9adc80a9fa89e71c.jpg)
[机缘参悟-53]:阳谋立身,阴谋防身

Flex开发网页实例web端
随机推荐
LeetCode 热题 HOT 100 -> 3. 无重复字符的最长子串
WMS you don't know
产品解读丨MeterSphere UI测试模块的设计与分布式扩展
软件测试面试题:常见的 POST 提交数据方式
结构伪类选择器—查找单个—查找多个—nth-of-type和伪元素
Likeshop takeout ordering system [100% open source, no encryption]
Promise从入门到精通 (第2章 Promise的理解和使用)
【网站搭建】使用acme.sh更新ssl证书:将zerossl改为letsencrypt
CeresDAO:Ventures DAO的“新代言”
mysql创建存储过程---------[HY000][1418] This function has none of DETERMINISTIC, NO SQL
Codeworks round 810 (Div. 2) a~c problem solution
你所不知道的WMS
【ROS进阶篇】第十讲 基于Gazebo的URDF集成仿真流程及实例
Sample imbalance - entry 0
Unittest unit test framework full stack knowledge
测试/开发程序员的级别“陷阱“,级别不是衡量单维度的能力......
Xiaomi website homepage big module - small module + navigation (floating case)
A lock faster than read-write lock. Don't get to know it quickly
[深入研究4G/5G/6G专题-42]: URLLC-14-《3GPP URLLC相关协议、规范、技术原理深度解读》-8-低延时技术-2-基于slot的调度与Slot内灵活的上下行符号配比
每条你收藏的资讯背后,都离不开TA