Basically, what I want to achieve is to avoid if statement with multiple checking weather object is null or collection is empty in the hierarchy. I read in the post from my above that this is possible with Optional "Null checks are automatically handled under the hood."

If there is some solution already, sorry for making duplicate and please refer me to it.

If you want to chain Optional, you can use its map(Function<? super T,? extends U> mapper) method to call the mapper function only if it is not null and use flatMap(Stream::findFirst) to get the first element of your Collection as next: