public static void swap(List list,int i,int j){
  Object tmp=list.get(i);
  list.set(i,list.get(j));
  list.set(j,tmp);
}

public static void swap ( List list , int i , int j ) { Object tmp = list . get ( i ) ; list . set ( i , list . get ( j ) ) ; list . set ( j , tmp ) ; }
swaps the values in the list at the given positions
