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