Hi I am using Java Optional. I saw that the Optional has a method ifPresent.
Instead of doing something like:
Optional object = someMeth
You could use #orElse or orElseThrow to improve the readbility of your code.
Optional object = someMethod(); String myValue = object.orElse(new MyObject()).getValue();
Optional object = someMethod(); String myValue = object.orElseThrow(RuntimeException::new).getValue();