code: public static <E> void swap(List<E> list, int index1, int index2) {
          TrivialSwap.swap(list, index1, list, index2);
      }
docs: Swap two elements of a list at the specified positions. The run time of this method
  depends on the implementation of the lists since elements are removed and added in the
  lists.
  
  @param <E> the type of elements in this list.
  
  @param list list that will have two of its values swapped.
  @param index1 one of the indexes of the list.
  @param index2 other index of the list.