Collections 工具类
在一些需要对集合进行特殊操作的时候,但是集合本身并么有为我们提供这样的操作的时候,我们可以尝试使用这个工具类
本文主要介绍Collections的常用方法,例如 Collections.sort()、Collections.shuffle()、Collections.reverse()、Collections.addAll()、Collections.copy()、Collections.binarySearch()、Collections.synchronizedXXX()
还有就是针对Collections.copy() 的方式源码进行讲解,从而避免IndexOutOfBoundsException: Source does not fit in dest
排序 sort
@Test
public void sort()