code: public static Method resolveMethod(Class<?> type, String methodName, Class<?>[] parameterTypes, Object[] arguments,
        Class<?> returnType) {
  
      try {
        return getMethod(type, methodName, parameterTypes);
      }
      catch (MethodNotFoundException cause) {
  
        Method method = findMethod(type, methodName, arguments);
  
        Assert.notNull(method, new MethodNotFoundException(String.format(
          "Failed to resolve method with signature [%1$s] on class type [%2$s]",
            getMethodSignature(methodName, parameterTypes, returnType), getName(type)), cause.getCause()));
  
        return method;
      }
    }
docs: Attempts to resolve the method with the specified name and signature on the given class type.  The named method's
  resolution is first attempted by using the specified method's name along with the array of parameter types.
  If unsuccessful, the method proceeds to lookup the named method by searching all "declared" methods
  of the class type having a signature compatible with the given argument types.  This method operates recursively
  until the method is resolved or the class type hierarchy is exhausted, in which case,
  a MethodNotFoundException is thrown.
  
  @param type the Class type on which to resolve the method.
  @param methodName a String indicating the name of the method to resolve.
  @param parameterTypes an array of Class objects used to resolve the exact signature of the method.
  @param arguments an array of Objects used in a method invocation serving as a fallback search/lookup strategy
  if the method cannot be resolved using it's parameter types.  Maybe null.
  @param returnType the declared class type of the method's return value (used only for Exception message purposes).
  @return the resolved method from the given class type given the name, parameter types (signature)
  and calling arguments, if any.
  @throws MethodNotFoundException if the specified method cannot be resolved on the given class type.
  @throws NullPointerException if the class type is null.
  @see #getMethod(Class, String, Class[])
  @see #findMethod(Class, String, Object...)
  @see java.lang.Class
  @see java.lang.reflect.Method