code: @Override
      public SingleSwapMove getRandomMove(PermutationSolution solution, Random rnd) {
          int n = solution.size();
          // check: move possible
          if(n < 2){
              return null;
          }
          // pick two random, distinct positions to swap
          int i = rnd.nextInt(n);
          int j = rnd.nextInt(n-1);
          if(j >= i){
              j++;
          }
          // generate swap move
          return new SingleSwapMove(i, j);
      }
docs: Create a random single swap move.
  
  @param solution permutation solution to which the move is to be applied
  @param rnd source of randomness used to generate random move
  @return random swap move, <code>null</code> if the permutation contains
  less than 2 items