code: public static Method[] getMethods(Class<?> clazz, String methodName, Class<?>[] expectedTypes,
                                        boolean exactParameterTypeMatch) {
          List<Method> matchingArgumentTypes = new LinkedList<Method>();
          Method[] methods = getMethods(clazz, methodName);
          for (Method method : methods) {
              final Class<?>[] parameterTypes = method.getParameterTypes();
              if (checkIfParameterTypesAreSame(method.isVarArgs(), expectedTypes, parameterTypes)
                          || (!exactParameterTypeMatch && checkIfParameterTypesAreSame(method.isVarArgs(),
                      convertParameterTypesToPrimitive(expectedTypes), parameterTypes))) {
                  matchingArgumentTypes.add(method);
              }
          }
          final Method[] methodArray = matchingArgumentTypes.toArray(new Method[0]);
          if (methodArray.length == 0) {
              throw new MethodNotFoundException(String.format(
                      "No methods matching the name(s) %s were found in the class hierarchy of %s.",
                      concatenateStrings(methodName), getType(clazz)));
          }
          return matchingArgumentTypes.toArray(new Method[matchingArgumentTypes.size()]);
      }
docs: Get an array of {@link Method}'s that matches the method name and whose
  argument types are assignable from {@code expectedTypes}. Both
  instance and static methods are taken into account.
  
  @param clazz                   The class that should contain the methods.
  @param methodName              Names of the methods that will be returned.
  @param expectedTypes           The methods must match
  @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 An array of Method's.