It is good programming practice, avoid null checking of a value, instead of using if (someObject! = Null), you can use Optional, it can be used as follows: Optional oR = Optional.of (Optional.ofNullable (yourOriginalInstanceToUse) .orElse (YourInsta...

Markdown supported · ⌘↵ to post
Shai Almog
Yak Barber, duck whisperer, hunter of bugs, feeder of dogs, heap climber, stack explorer and rider of shells
That's an option ;-)
Notice that optional isn't "free" and carries an overhead on top of null .
It's not a big deal but personally I like null .