Почему PUTIFABSENT по сравнению с NULL в этой реализации DistryByKey?JAVA

Программисты JAVA общаются здесь
Anonymous
Почему PUTIFABSENT по сравнению с NULL в этой реализации DistryByKey?

Сообщение Anonymous »

Код: Выделить всё

public List getFilteredList(List l1) {
return l1
.stream()
.filter(distinctByKey(XYZ::getName))
.filter(distinctByKey(XYZ::getPrice))
.collect(Collectors.toList());
}

private static  Predicate distinctByKey(Function

Подробнее здесь: [url]https://stackoverflow.com/questions/72571561/why-is-putifabsent-compared-with-null-in-this-implementation-of-distinctbykey[/url]

Вернуться в «JAVA»