Java 8 introduced the optional class, a special wrapping class designed to prevent NullPointerExceptions. This last class can be found in the java.util package. When we don't do the Null checks, NullPointerExceptions happen.