docs: private DistributionSetAssignmentResult assignDistributionSetToTargets(final Long dsID,
              final Collection<TargetWithActionType> targetsWithActionType, final String actionMessage,
              final AbstractDsAssignmentStrategy assignmentStrategy) {
  
          final JpaDistributionSet distributionSetEntity = getAndValidateDsById(dsID);
          final List<String> controllerIDs = getControllerIdsForAssignmentAndCheckQuota(targetsWithActionType,
                  distributionSetEntity);
          final List<JpaTarget> targetEntities = assignmentStrategy.findTargetsForAssignment(controllerIDs,
                  distributionSetEntity.getId());
  
          if (targetEntities.isEmpty()) {
              // detaching as it is not necessary to persist the set itself
              entityManager.detach(distributionSetEntity);
              // return with nothing as all targets had the DS already assigned
              return new DistributionSetAssignmentResult(Collections.emptyList(), 0, targetsWithActionType.size(),
                      Collections.emptyList(), targetManagement);
          }
  
          // split tIDs length into max entries in-statement because many database
          // have constraint of max entries in in-statements e.g. Oracle with
          // maximum 1000 elements, so we need to split the entries here and
          // execute multiple statements
          final List<List<Long>> targetEntitiesIdsChunks = Lists.partition(
                  targetEntities.stream().map(Target::getId).collect(Collectors.toList()),
                  Constants.MAX_ENTRIES_IN_STATEMENT);
  
          // override all active actions and set them into canceling state, we
          // need to remember which one we have been switched to canceling state
          // because for targets which we have changed to canceling we don't want
          // to publish the new action update event.
          final Set<Long> cancelingTargetEntitiesIds = closeOrCancelActiveActions(assignmentStrategy,
                  targetEntitiesIdsChunks);
          // cancel all scheduled actions which are in-active, these actions were
          // not active before and the manual assignment which has been done
          // cancels them
          targetEntitiesIdsChunks.forEach(this::cancelInactiveScheduledActionsForTargets);
  
          setAssignedDistributionSetAndTargetUpdateStatus(assignmentStrategy, distributionSetEntity,
                  targetEntitiesIdsChunks);
  
          final Map<String, JpaAction> controllerIdsToActions = createActions(targetsWithActionType, targetEntities,
                  assignmentStrategy, distributionSetEntity);
          // create initial action status when action is created so we remember
          // the initial running status because we will change the status
          // of the action itself and with this action status we have a nicer
          // action history.
          createActionsStatus(controllerIdsToActions.values(), assignmentStrategy, actionMessage);
  
          detachEntitiesAndSendAssignmentEvents(distributionSetEntity, targetEntities, assignmentStrategy,
                  cancelingTargetEntitiesIds, controllerIdsToActions);
  
          return new DistributionSetAssignmentResult(
                  targetEntities.stream().map(Target::getControllerId).collect(Collectors.toList()),
                  targetEntities.size(), controllerIDs.size() - targetEntities.size(),
                  Lists.newArrayList(controllerIdsToActions.values()), targetManagement);
      }