You could use a filter:
Optional.ofNullable(s).filter(not(String::isEmpty));
That will return an empty Optional if ppo
is null or empty.
You could use a filter:
Optional.ofNullable(s).filter(not(String::isEmpty));
That will return an empty Optional if ppo
is null or empty.