public static Method[] findMethodsByExactParameters(Class<?> clazz, Class<?> returnType, Class<?>... parameterTypes) {
        List<Method> result = new LinkedList<Method>();
        for (Method method : clazz.getDeclaredMethods()) {
            if (returnType != null && returnType != method.getReturnType())
                continue;

            Class<?>[] methodParameterTypes = method.getParameterTypes();
            if (parameterTypes.length != methodParameterTypes.length)
                continue;

            boolean match = true;
            for (int i = 0; i < parameterTypes.length; i++) {
                if (parameterTypes[i] != methodParameterTypes[i]) {
                    match = false;
                    break;
                }
            }

            if (!match)
                continue;

            method.setAccessible(true);
            result.add(method);
        }
        return result.toArray(new Method[result.size()]);
    }
Returns an array of all methods declared/overridden in a class with the specified parameter types.

<p>The return type is optional, it will not be compared if it is {@code null}.
Use {@code void.class} if you want to search for methods returning nothing.

@param clazz          The class to look in.
@param returnType     The return type, or {@code null} (see above).
@param parameterTypes The parameter types.
@return An array with matching methods, all set to accessible already.
android/android_framework/base/src/main/java/util/XposedHelpers.java