public static @NonNull
    <T> T checkNotNull(final T reference,
                       final String messageTemplate,
                       final Object... messageArgs) {
        if (reference == null) {
            throw new NullPointerException(String.format(messageTemplate, messageArgs));
        }
        return reference;
    }
Ensures that an object reference passed as a parameter to the calling
method is not null.

@param reference       an object reference
@param messageTemplate a printf-style message template to use if the check fails; will
                       be converted to a string using {@link String#format(String, Object...)}
@param messageArgs     arguments for {@code messageTemplate}
@return the non-null reference that was validated
@throws NullPointerException if {@code reference} is null
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/Preconditions.java