code: @SuppressWarnings("unchecked")
      protected <I> I createIdentifier(Class<I> aggregateIdClass, I id, Object... parameters) {
          if (id != null) {
              if (aggregateIdClass.isAssignableFrom(id.getClass())) {
                  return id;
              } else {
                  throw BusinessException.createNew(BusinessErrorCode.RESOLVED_DTO_ID_IS_INVALID)
                          .put("dtoIdClass", id.getClass()
                                  .getName())
                          .put("aggregateIdClass", aggregateIdClass.getName());
              }
          } else {
              if (!Producible.class.isAssignableFrom(aggregateIdClass)) {
                  throw BusinessException.createNew(BusinessErrorCode.RESOLVED_DTO_ID_IS_NOT_PRODUCIBLE)
                          .put("aggregateIdClass", aggregateIdClass.getName());
              } else {
                  return (I) domainRegistry.getFactory(aggregateIdClass.asSubclass(Producible.class))
                          .create(parameters);
              }
          }
      }
docs: Implements the logic to create an aggregate identifier, using a factory if the identifier class
  implements {@link Producible}.
  
  @param aggregateIdClass the identifier class.
  @param id               the existing identifier if any.
  @param parameters       the parameters to pass to the factory if any.
  @param <I>              the type of the aggregate root identifier.
  @return the identifier.