code: public void swap(int i, int j){
          try{
              // swap items
              Collections.swap(order, i, j);
          } catch (IndexOutOfBoundsException ex){
              throw new SolutionModificationException("Error while modifying permutation solution: swapped positions should be positive "
                                                      + "and smaller than the number of items in the permutation.", this);
          }
      }
docs: Swap the items at position i and j in the permutation.
  Both positions should be positive and smaller than the
  number of items in the permutation.
  
  @param i position of first item to be swapped
  @param j position of second item to be swapped
  @throws SolutionModificationException if <code>i</code> or <code>j</code> is
  =     *                                      negative, or larger than or equal to the
  number of items in the permutation