Why use Optional.of over Optional.ofNullable?
Uses for Optional
Why isn't there an Optional.or(Optional default) method? Using Java Optional.ofNullable effectively Java - Optional loop How to return when an optional is empty? Java 8 example for if else with Optional Optional method in Java Interface Use of Optional in a map Return value from Optional Java 8 Optional return type Good way to convert Optional<Integer> to Optional<Long> Optional.ofNullable and method chaining Java Optional for method argument? What's the difference between Objects.requireNonNullElse() and Optional.ofNullable().orElse()? Is it ok to use Optional.ofNullable for checking if null and assigning default value How can I map an optional into a primitive optional? Java 8 Optional<T> get How to use `Optional.ofNullable(variable)` in java 7 version Replace get/test/set of bare references with Optional.ofNullable(...).ifPresent(...)? How do I use methods with optional data Get value from one Optional or another Optional.ofNullable(i).ifPresent... vs if (i != null) Optional method parameter in Java Java Optional.ofNullable with Mockito Java 8 Optional Java 8 Optional get() method Possible redundant object creation with Optional#ofNullable? Java 8 Optional instead of if Java - make a library and import optional Optional ofNullable execution flow in java 8