public static<T extends Comparable<T>> void bubbleSort(List<T>list) {
		if (!(list instanceof RandomAccess)) list=new ArrayList<>(list);
		for (int i=0,n=list.size();i<n;++i) 
			for (int j=1;j<n-i;++j) 
				if(list.get(j).compareTo(list.get(j-1))<=0) Collections.swap(list,j-1,j);
	}