Given a String I need to get an Optional, whereby if the String is null or empty the result would be Optional.empty. I can do it this way:
String ppo = \"\"; Opt
Java 11 answer:
var optionalString = Optional.ofNullable(str).filter(Predicate.not(String::isBlank));
String::isBlank deals with a broader range of 'empty' characters.
String::isBlank