比较两个List元素是否相同
/** <Description functions in a word>
* <Detail description>
* @param <T>
* @param a
* @param b
* @return [Parameters description]
*
* @return boolean [Return type description]
* @exception throws [Excetion] [Exception description]
* @see [Related classes#Related methods#Related properties]
*/
public synchronized <T extends Comparable<T>> boolean compare(List<T> a, List<T> b) {
if(a.size() != b.size())
return false;
Collections.sort(a);
Collections.sort(b);
for(int i=0;i<a.size();i++){
if(!a.get(i).equals(b.get(i)))
return false;
}
return true;
}
查找出两个list的不同元素
public List<String> getDiffElementUseMap(List<String> list1,List<String> list2){ //获得两个list中的不同元素,map方法
<