docs: private Object invokeMethod(final Object obj, final Method method, final Object... args) {
          // turn method to accessible. otherwise, we won't be able to callback to methods
          // on non-public classes.
          boolean accessibility = method.isAccessible();
          method.setAccessible(true);
  
          try {
              try {
                  return method.invoke(obj, args);
              } catch (Exception e) {
                  this.log("Error while invoking %s with %s: %s", method, Arrays.toString(args), Throwables.getStackTraceAsString(e));
                  throw e;
              }
          } catch (InvocationTargetException e) {
              throw new JsiiException(e.getTargetException());
          } catch (IllegalAccessException e) {
              throw new JsiiException(e);
          } finally {
              // revert accessibility.
              method.setAccessible(accessibility);
          }
      }