Anti Pattern: Don’t use Optionals for data repositories

Java 8 Optionals Java 8 introduced a new feature call Optionals. Optionals are an easy way to force the caller of a method to deal with a possible null return value:

If you use an Optional as the return type of your method, whoever calls the method will be reminded that it might return […]