This class is introduced in Java 8.
Optional.ofNullable(.)
- allows passed parameter to be null.
Optional.of(.)
- throws NullPointerException if passed parameter is null
optional.isPresent(.)
- checks the value is present or not
optional.orElse(.)
- returns the value if present otherwise returns, the default value passed
optional.get()
- gets the value, value should be present
`optional.map(.).orElse(.);