code: public BUILDER setCapabilityReference(String referencedCapability, RuntimeCapability<?> dependentCapability) {
          if (dependentCapability.isDynamicallyNamed()) {
              return setCapabilityReference(referencedCapability, dependentCapability.getName());
          } else {
              //noinspection deprecation
              return setCapabilityReference(referencedCapability, dependentCapability.getName(), false);
          }
      }
docs: Records that this attribute's value represents a reference to an instance of a
  {@link org.jboss.as.controller.capability.RuntimeCapability#isDynamicallyNamed() dynamic capability}.
  <p>
  This method is a convenience method equivalent to calling
  {@link #setCapabilityReference(CapabilityReferenceRecorder)}
  passing in a {@link org.jboss.as.controller.CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder}
  constructed using the parameters passed to this method.
  
  @param referencedCapability the name of the dynamic capability the dynamic portion of whose name is
  represented by the attribute's value
  @param dependentCapability  the capability that depends on {@code referencedCapability}
  @return the builder
  @see AttributeDefinition#addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
  @see AttributeDefinition#removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)