数组中过滤对象
//过滤掉bindList不存在list中的对象(根据两个对象的id)
List<MaterielBindingDetailsEntity> bindList = new ArrayList<>();
bindList.add(objec1);
bindList.add(objec2);
.....
for (Object str : list) {
bindList = bindList.stream()
.filter(d -> !d.getMaterielId().equals(str.getMaterielId()))
.collect(Collectors.toList());
}//bindList就是过滤之后存在的集合
总结
数组过滤数组、数组过滤对象等皆适合