Convert some usages of java.util.Optional