Java Language Basic use for object null check


Example

For null check in method

Object nullableObject = methodReturnObject();
if (Objects.isNull(nullableObject)) {
    return;
}

For not null check in method

Object nullableObject = methodReturnObject();
if (Objects.nonNull(nullableObject)) {
    return;
}