code: static boolean checkArgumentTypesMatchParameterTypes(boolean isVarArgs, Class<?>[] parameterTypes,
                                                                   Object[] arguments) {
          if (parameterTypes == null) {
              throw new IllegalArgumentException("parameter types cannot be null");
          } else if (!isVarArgs && arguments.length != parameterTypes.length) {
              return false;
          }
          for (int i = 0; i < arguments.length; i++) {
              Object argument = arguments[i];
              if (argument == null) {
                  final int index;
                  if (i >= parameterTypes.length) {
                      index = parameterTypes.length - 1;
                  } else {
                      index = i;
                  }
                  final Class<?> type = parameterTypes[index];
                  if (type.isPrimitive()) {
                      // Primitives cannot be null
                      return false;
                  } else {
                      continue;
                  }
              } else if (i >= parameterTypes.length) {
                  if (isAssignableFrom(parameterTypes[parameterTypes.length - 1], getType(argument))) {
                      continue;
                  } else {
                      return false;
                  }
              } else {
                  boolean assignableFrom = isAssignableFrom(parameterTypes[i], getType(argument));
                  final boolean isClass = parameterTypes[i].equals(Class.class) && isClass(argument);
                  if (!assignableFrom && !isClass) {
                      return false;
                  }
              }
          }
          return true;
      }
docs: Check argument types match parameter types.
  
  @param isVarArgs      If the last parameter is a var args.
  @param parameterTypes the parameter types
  @param arguments      the arguments
  @return if all actual parameter types are assignable from the expected
  arguments, otherwise.