code: private static <T> void swapReferences( T[] arr, int idx1, int idx2 )
      {
          T tmp = arr[idx1];
          arr[idx1] = arr[idx2];
          arr[idx2] = tmp;
      }
docs: method to swap elements in an array
  
  @param arr an array of Objects
  @param idx1 the index of the first element
  @param idx2 the index of the second element