I\'m looking to make my code more readable as well as use tooling like IDE code inspection and/or static code analysis (FindBugs and Sonar) to avoid NullPointerExceptions.
Spring 5 has @NonNullApi at the package level. This seems like a convenient choice for a project that already has Spring dependencies. All fields, parameters and return values default to @NonNull and @Nullable can be applied in the few places that differ.
File package-info.java:
@org.springframework.lang.NonNullApi
package com.acme;
https://docs.spring.io/spring-data/commons/docs/current/reference/html/#repositories.nullability.annotations