Java Optional

Java Optional is a container object which may or may not contain a value. Introduced in Java 2014 with Java 8, Optional is used to represent the potential absence of a value, helping to avoid NullPointerException and making the code more expressive. It can be used to handle nullable return values more safely and provides methods like Java isPresent() and Java ifPresent() to check and act on the presence of a value in a clean and concise way.

https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html