code: public static Object invokeMethod(Object bean, Method method, Object... args) throws Exception {
          Class<?>[] types    = method.getParameterTypes();
          int        argCount = args == null ? 0 : args.length;
          // 参数个数对不上
          if (argCount != types.length) {
              throw new IllegalStateException(String.format("%s in %s", method.getName(), bean));
          }
  
          // 转参数类型
          for (int i = 0; i < argCount; i++) {
              args[i] = cast(args[i], types[i]);
          }
          return method.invoke(bean, args);
      }
docs: invoke method
  
  @param bean   bean instance
  @param method method instance
  @param args   method arguments
  @return return method returned value
  @throws Exception throws Exception