I do the same (both here and YT). I stay away from algorithmic anything. If something is too high volume to avoid it, I'd rather avoid that something.
if (nullableVariable != null) {
boolean success = nullableVariable.someMethodCall()
if (success) {
return success;
}
}
return fallbackIfNullMethodCall();
And even that can be more concise if you prefer: if (nullableVariable != null && nullableVariable.someMethodCall()) {
return true;
}
return fallbackIfNullMethodCall();