Using NotNull Annotation in method argument
@Nullable and @NotNull do nothing on their own. They are supposed to act as Documentation tools. The @Nullable Annotation reminds you about the necessity to introduce an NPE check when: Calling methods that can return null. Dereferencing variables (fields, local variables, parameters) that can be null. The @NotNull Annotation is, actually, an explicit contract declaring the following: A method should not return … Read more