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
If you use Guava, you can just do:
Optional ostr = Optional.ofNullable(Strings.emptyToNull(ppo));