code: public static <T> void swap(T[] arr, int a, int b) {
  		if (a < 0 || a > arr.length || b < 0 || b > arr.length)
  			throw new IllegalArgumentException("swap position out of bounds.");
  		if (a != b) {
  			T t = arr[a];
  			arr[a] = arr[b];
  			arr[b] = t;
  		}
  	}
docs: Swaps the elements at position <code>a</code> and <code>b</code> in the
  array <code>arr</code>.
  
  @param <T>
  Type of array elements
  @param arr
  Array that contains the elements to be swapped
  @param a
  First position
  @param b
  Second position