Start here. This is the direct spoken answer to practice first.
Overview
Optional is most useful when a method may legitimately return no value and callers should handle that possibility explicitly.
Use Optional<T> mainly as a return type when a method may legitimately produce no result, such as finding a user by an alternate key. Return Optional.empty() rather than null, and avoid calling get unless presence is already guaranteed. Prefer map, flatMap, orElseThrow, or a clear fallback to keep absence handling near the call. It is not a replacement for every nullable field, parameter, collection, or validation error.