code: @Override
      public Object invoke(Object[] vals) throws InvocationTargetException {
          Object[] tmp;
          int i;
  
          try {
              if (isStatic()) {
                  return meth.invoke(null, vals);
              } else {
                  if (vals.length == 0) {
                      throw new IllegalArgumentException("invalid arguments");
                  }
  
                  tmp = new Object[vals.length - 1];
                  for (i = 1; i < vals.length; i++) {
                      tmp[i-1] = vals[i];
                  }
  
                  return meth.invoke(vals[0], tmp);
              }
          } catch (InvocationTargetException | IllegalArgumentException e) {
              throw e;
          } catch (IllegalAccessException e) {
              // isValid should prevent this
              throw new RuntimeException("can't access method");
          }
      }
docs: Invokes the wrapped Java Method. Throws Exceptions raised in the
  Java Method.
  @param   vals  arguments to the Java Method
  @return  Object returned be the Java Method or the Object the method
  is invoked on.