@SuppressWarnings({"rawtypes", "unchecked"})
public static void swap (List<?> list, int i, int j)

Swaps the elements at the specified positions in the specified list. (If the specified positions are equal, invoking this method leaves the list unchanged.)

Parameters:
list    The list in which to swap elements.
i    the index of one element to be swapped.
j    the index of the other element to be swapped.

Exceptions:
IndexOutOfBoundsException    if either i or j is out of range (i < 0 || i >= list.size() || j < 0 || j >= list.size()).

Since:  1.4