code: public static <T> T[] swap(T[] array, int indexOne, int indexTwo) {
  
      T elementAtIndexOne = array[indexOne];
  
      array[indexOne] = array[indexTwo];
      array[indexTwo] = elementAtIndexOne;
  
      return array;
    }
docs: Swaps elements in the array at indexOne and indexTwo.
  
  @param <T> Class type of the elements in the array.
  @param array array with the elements to swap.
  @param indexOne index of the first element to swap.
  @param indexTwo index of the second element to swap.
  @return the array with the specified elements at indexOne and indexTwo swapped.
  @throws ArrayIndexOutOfBoundsException if the indexes are not valid indexes in the array.
  @throws NullPointerException if the array is null.