private static Method getAccessibleMethodFromSuperclass(Class<?> cls,
            String methodName, Class<?>... parameterTypes) {
        Class<?> parentClass = cls.getSuperclass();
        while (parentClass != null) {
            if (Modifier.isPublic(parentClass.getModifiers())) {
                try {
                    return parentClass.getMethod(methodName, parameterTypes);
                } catch (NoSuchMethodException e) {
                    return null;
                }
            }
            parentClass = parentClass.getSuperclass();
        }
        return null;
    }
<p>Returns an accessible method (that is, one that can be invoked via
reflection) by scanning through the superclasses. If no such method
can be found, return <code>null</code>.</p>

@param cls Class to be checked
@param methodName Method name of the method we wish to call
@param parameterTypes The parameter type signatures
@return the accessible method or <code>null</code> if not found
android/android_framework/base/src/main/java/lang3/reflect/MethodUtils.java