code: protected Object[] validateArguments(Method method, Object... args) {
      Assert.notNull(method, "Method cannot be null");
  
      Object[] arguments = nullSafeArray(args);
  
      int methodParameterCount = method.getParameterCount();
  
      assertThat(arguments.length)
        .throwing(newIllegalArgumentException(
          "The number of arguments [%1$d] does not match the number of parameters [%2$d] for method [%3$s] in class [%4$s]",
          arguments.length, methodParameterCount, method.getName(), method.getDeclaringClass().getName()))
        .isEqualTo(methodParameterCount);
  
      Class<?>[] parameterTypes = method.getParameterTypes();
  
      int parameterIndex = 0;
  
      for (Object argument : arguments) {
        assertThat(argument)
          .throwing(newIllegalArgumentException("Argument [%1$s] is not assignable to parameter [%2$d] of type [%3$s]",
            argument, parameterIndex, parameterTypes[parameterIndex].getName()))
          .isAssignableTo(parameterTypes[parameterIndex++]);
      }
  
      return arguments;
    }
docs: Validates the array of {@link Object arguments} to be passed to the {@link Method} by comparing
  the {@link Object arguments} to the given {@link Method Method's} declared parameters.
  
  @param method {@link Method} used to validate the array of {@link Object arguments}.
  @param args array of {@link Object arguments} to validate.
  @return the given array of {@link Object arguments}.
  @throws IllegalArgumentException if {@link Method} is {@literal null}, or the number of arguments
  does not equal the number of {@link Method} parameters, or an argument does not the match the type
  of the corresponding {@link Method} parameter.
  @see java.lang.reflect.Method