public static final Method getMethod(final Class clazz, final String methodName, Class... parameters) {
        parameters = parameters == null ? new Class[0] : parameters;
        Method method = null;
        try {
            method = clazz.getMethod(methodName, parameters);
        } catch (NoSuchMethodException e) {
        }
        if (method != null) {
            return method;
        }
        Class[] parameterTypes = null;
        final Method[] methods = clazz.getMethods();
        for (int i = methods.length - 1; i >= 0; i--) {
            if (!methodName.equals(methods[i].getName())) {
                continue;
            }
            parameterTypes = methods[i].getParameterTypes();
            if (parameterTypes.length != parameters.length) {
                continue;
            }
            boolean classMatch = true;
            for (int j = parameterTypes.length - 1; j >= 0; j--) {
                if (!classMatch(parameterTypes[j], parameters[j])) {
                    classMatch = false;
                    break;
                }
            }
            if (classMatch) {
                method = methods[i];
                break;
            }
        }
        return method;
    }