code: @Override
      public void apply(PermutationSolution solution) {
          int start = from;
          int stop = to;
          int n = solution.size();
          // reverse subsequence by performing a series of swaps
          // (works cyclically when start > stop)
          int reversedLength;
          if(start < stop){
              reversedLength = stop-start+1;
          } else {
              reversedLength = n - (start-stop-1);
          }
          int numSwaps = reversedLength/2;
          for(int k=0; k<numSwaps; k++){
              solution.swap(start, stop);
              start = (start+1) % n;
              stop = (stop-1+n) % n;
          }
      }
docs: Reverse the subsequence by performing a series of swaps in the given permutation solution.
  
  @param solution permutation solution to which the move is to be applied