code: public static Method getBestMethodCandidate(Class<?> cls, String methodName, Class<?>[] signature,
                                                  boolean exactParameterTypeMatch) {
          final Method foundMethod;
          final Method[] methods = getMethods(cls, methodName, signature, exactParameterTypeMatch);
          if (methods.length == 1) {
              foundMethod = methods[0];
          } else {
              // We've found overloaded methods, we need to find the best one to invoke.
              Arrays.sort(methods, ComparatorFactory.createMethodComparator());
              foundMethod = methods[0];
          }
          return foundMethod;
      }
docs: Gets the best method candidate.
  
  @param cls                     the cls
  @param methodName              the method name
  @param signature               the signature
  @param exactParameterTypeMatch {@code true} if the {@code expectedTypes} must match
  the parameter types must match exactly, {@code false} if
  the {@code expectedTypes} are allowed to be converted
  into primitive types if they are of a wrapped type and still
  match.
  @return the best method candidate