📅  最后修改于: 2022-03-11 14:52:44.801000             🧑  作者: Mango
// Note that you shouldn't normally use == on objects
Predicate itemPredicate = d-> item.equals(d.getItem());
Predicate namePredicate = d-> name.equals(d.getName());
details.stream()
.filter(itemPredicate.and(namePredicate))
.collect(Collectors.toList());