private static Method getAccessibleMethodFromInterfaceNest(Class<?> cls,
            String methodName, Class<?>... parameterTypes) {
        Method method = null;

        // Search up the superclass chain
        for (; cls != null; cls = cls.getSuperclass()) {

            // Check the implemented interfaces of the parent class
            Class<?>[] interfaces = cls.getInterfaces();
            for (int i = 0; i < interfaces.length; i++) {
                // Is this interface public?
                if (!Modifier.isPublic(interfaces[i].getModifiers())) {
                    continue;
                }
                // Does the method exist on this interface?
                try {
                    method = interfaces[i].getDeclaredMethod(methodName,
                            parameterTypes);
                } catch (NoSuchMethodException e) { // NOPMD
                    /*
                     * Swallow, if no method is found after the loop then this
                     * method returns null.
                     */
                }
                if (method != null) {
                    break;
                }
                // Recursively check our parent interfaces
                method = getAccessibleMethodFromInterfaceNest(interfaces[i],
                        methodName, parameterTypes);
                if (method != null) {
                    break;
                }
            }
        }
        return method;
    }
<p>Returns an accessible method (that is, one that can be invoked via
reflection) that implements the specified method, by scanning through
all implemented interfaces and subinterfaces.  If no such method
can be found, return <code>null</code>.</p>

<p>There isn't any good reason why this method must be private.
It is because there doesn't seem any reason why other classes should
call this rather than the higher level methods.</p>

@param cls Parent class for the interfaces 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