1// Note that you shouldn't normally use == on objects
2Predicate<Detail> itemPredicate = d-> item.equals(d.getItem());
3Predicate<Detail> namePredicate = d-> name.equals(d.getName());
4
5details.stream()
6 .filter(itemPredicate.and(namePredicate))
7 .collect(Collectors.toList());