private Method findMethod(String beanName, Class type, String methodName, MethodParameter[] parameters) {
        Method[] declaredMethods = type.getDeclaredMethods();
        for (Method declaredMethod : declaredMethods) {
            if (methodName.equals(declaredMethod.getName())) {
                if (declaredMethod.getParameterTypes().length == parameters.length) {
                    return declaredMethod;
                }
            }
        }

        if (Object.class.equals(type)) {
            throw Exceptions.runtime("Could not find method %s::%s", beanName, methodName);
        }
        return findMethod(beanName, type.getSuperclass(), methodName, parameters);
    }