code: DecoratorConfiguration removeReferencesOrDeleteIfEmpty(
        List<Object> decoratorParametersToRemove, DecoratorConfiguration configuration) {
      List<DecoratorParameters> decoratorParameters =
          stream(
                  configuration.getEntities(PARAMETERS, DecoratorParameters.class).spliterator(),
                  false)
              .filter(parameters -> !decoratorParametersToRemove.contains(parameters.getId()))
              .collect(toList());
  
      if (decoratorParameters.isEmpty()) {
        dataService.deleteById(DECORATOR_CONFIGURATION, configuration.getIdValue());
        return null;
      } else {
        configuration.setDecoratorParameters(decoratorParameters.stream());
        return configuration;
      }
    }
docs: Removes references to DecoratorParameters that will be deleted. If this results in a
  DecoratorConfiguration without any parameters, then the row is deleted.
  
  @return DecoratorConfiguration without references to DecoratorParameters that will be deleted,
  null if the row was deleted