We would like to know how to create Optional from null.
/*from w ww .j a v a2s . c om*/ import java.util.Optional; public class Main { public static void main(String[] args) { String str = null; Optional value = Optional.of(str); } }