code: public void registerObject(final JsiiObjectRef objRef, final Object obj) {
          if (obj instanceof JsiiObject) {
              ((JsiiObject) obj).setObjRef(objRef);
          }
          this.objects.put(objRef.getObjId(), obj);
      }
docs: Registers an object into the object cache.
  @param objRef The object reference.
  @param obj The object to register.