public static <T> T[] checkArrayElementsNotNull(final T[] value, final String valueName) {
        if (value == null) {
            throw new NullPointerException(valueName + " must not be null");
        }

        for (int i = 0; i < value.length; ++i) {
            if (value[i] == null) {
                throw new NullPointerException(
                        String.format("%s[%d] must not be null", valueName, i));
            }
        }

        return value;
    }
Ensures that the array is not {@code null}, and none of its elements are {@code null}.

@param value     an array of boxed objects
@param valueName the name of the argument to use if the check fails
@return the validated array
@throws NullPointerException if the {@code value} or any of its elements were {@code null}
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/Preconditions.java