Set usage of Objects.isNull and Objects.nonNull as code smells

While using this method does not create any problem, I consider it a code smell because this method was designed to be used along with lambdas and not for other usages

Description of the method from the java docs :

API Note:

This method exists to be used as a Predicate , filter(Objects::isNull)

  • snippet of Noncompliant Code
if (Objects.isNull(object)) {
  • snippet of Compliant Code (fixing the above noncompliant code)
if (object == null) {

  • exceptions to the Noncompliant Code, i.e. conditions in which the noncompliant code should not raise an issue so that we reduce the number of False Positives.

This should not be marked as a code smell when used within java streams.Example :

Java docs : Objects (Java Platform SE 8 )