public static void sortList(List list,Comparator comparator){
  if (SystemUtils.IS_JAVA_1_7 && list instanceof CopyOnWriteArrayList) {
    List tempList=new ArrayList(list);
    Collections.sort(tempList,comparator);
    list.clear();
    list.addAll(tempList);
  }
 else {
    Collections.sort(list,comparator);
  }
}

public static void sortList ( List list , Comparator comparator ) { if ( SystemUtils . IS_JAVA_1_7 && list instanceof CopyOnWriteArrayList ) { List tempList = new ArrayList ( list ) ; Collections . sort ( tempList , comparator ) ; list . clear ( ) ; list . addAll ( tempList ) ; } else { Collections . sort ( list , comparator ) ; } }
sorts the list . since copyonwritearraylists are not sortable with java7 , we need this wrapper to sort it differently on java7 .
