public static <T> void swap(final List<T> list, final int i, final int j) {
		final T old = list.get(i);
		list.set(i, list.get(j));
		list.set(j, old);
	}
Swap two elements of a given list.

@param <T> the list type.
@param list the array
@param i index of the first list element.
@param j index of the second list element.
@throws IndexOutOfBoundsException if <tt>i &lt; 0</tt> or
			<tt>j &lt; 0</tt> or <tt>i &gt; a.length</tt> or
			<tt>j &gt; a.length</tt>
@throws NullPointerException if the give list is {@code null}.
jenetics/src/test/java/io/jenetics/util/lists.java