Purpose of Objects.isNull(...) / Objects.nonNull(...)
What is the purpose of
Objects.isNull(x)
if we can simply write
x == null
?
Same for
Objects.nonNull(...)
and
x != null
From the JavaDoc of the method:
API Note: This method exists to be used as a
Predicate
,filter(Objects::isNull)