code: public Throwable getThrowable(Object[] args) {
      Throwable rv = null;
      if (args.length > 0) {
        if (args[args.length - 1] instanceof Throwable) {
          rv = (Throwable) args[args.length - 1];
        }
      }
      return rv;
    }
docs: Get the throwable from the last element of this array if it is Throwable,
  else null.