code: public static void swap(double[] doubleArray1, int array1Index, double[] doubleArray2, int array2Index) {
          if(doubleArray1[array1Index] != doubleArray2[array2Index]) {
              double hold = doubleArray1[array1Index];
              doubleArray1[array1Index] = doubleArray2[array2Index];
              doubleArray2[array2Index] = hold;
          }
          
      }
docs: Swap the elements of two double arrays at the specified positions.
  
  @param doubleArray1 one of the arrays that will have one of its values swapped.
  @param array1Index the index of the first array that will be swapped.
  @param doubleArray2 the other array that will have one of its values swapped.
  @param array2Index the index of the second array that will be swapped.