code: public void addDependentResourceReference(ResourceReference<?> resourceReference) {
          if (resourceReferences == null) {
              this.resourceReferences = new ArrayList<ResourceReference<?>>();
          }
          this.resourceReferences.add(resourceReference);
      }
docs: Register a {@link ResourceReference} as a dependency. {@link ResourceReference#release()} will be called on every {@link ResourceReference} once this
  {@link CreationalContext} instance is released.