code: public static Method bestMatchingMethod(Collection<Method> methods, String methodName, Class[] types) {
        if (methods == null || StringUtils.isNullOrBlank(methodName) || types == null) {
           return null;
        }
        for (Method method : methods) {
           if (method.getName().equals(methodName) && typesMatch(method.getParameterTypes(), types)) {
              return method;
           }
        }
        return null;
     }
docs: Finds the best Method match for a given method name and types against a collection of methods.
  
  @param methods    The collections of methods to choose from
  @param methodName The name of the method we want to match
  @param types      The types that we want to pass to the method.
  @return Null if there is no match, otherwise the Method which bests fits the given method name and types