Optional<T> (Java 8+) is a container that may or may not hold a value — an explicit way to represent "a value might be absent" instead of returning null. It helps prevent the dreaded NullPointerException (NPE) by forcing callers to consider the empty case.
The problem: null and NPEs
User {
userMap.get(id);
}
findUser();
u.getName();
