private static Method initializeMethod(
            Class<?> clazz, String methodName, Class<?>... methodParams) {
        try {
            for (Class<?> paramClass : methodParams) {
                if (paramClass == null) {
                    return null;
                }
            }
            if (clazz != null) {
                return clazz.getMethod(checkNotNull(methodName), methodParams);
            }
        } catch (NoSuchMethodException ignored) {
            // Ignored
        }
        return null;
    }
Instantiates a new OptionalMethod.
<p>Does not throw any exceptions if the class or method can't be loaded, or if any parameter
classes are {@code null} and instead behaves as a no-op, always returning {@code null}.

@param clazz the Class to search for methods on
@param methodName the name of the {@code Method} on {@code clazz}
@param methodParams list of {@code Classes} of the {@code Method's} parameters

@throws NullPointerException if the method name is {@code null}
common/src/main/java/org/conscrypt/metrics/OptionalMethod.java