These specialized Optional types avoid the need for boxing and unboxing, providing a more efficient way to handle primitive values that may or may not be present.
Source Code
OptionalInt optionalInt = OptionalInt.of(123);
if (optionalInt.isPresent()) {
System.out.println("Value: " + optionalInt.getAsInt());
}