code: @Override
      public void apply(SubsetSolution solution) {
          // add IDs
          for(int ID : add){
              if(!solution.select(ID)){
                  throw new SolutionModificationException("Cannot add ID " + ID + " to selection (already selected).", solution);
              }
          }
          // remove IDs
          for(int ID : delete){
              if(!solution.deselect(ID)){
                  throw new SolutionModificationException("Cannot remove ID " + ID + " from selection (currently not selected).", solution);
              }
          }
      }
docs: Apply this move to a given subset solution. The move can only be applied to a solution
  for which none of the added IDs are currently already selected and none of the removed
  IDs are currently not selected. This guarantees that calling {@link #undo(SubsetSolution)}
  will correctly undo the move.
  
  @throws SolutionModificationException if some added ID is already selected, some removed ID is currently
  not selected, or any ID does not correspond to an underlying entity
  @param solution solution to which to move will be applied