public static List<Map<Object,Object>> sortMaps(List<Map<Object,Object>> listOfMaps,List<? extends String> sortKeys){
  if (listOfMaps == null || sortKeys == null)   return null;
  List<Map<Object,Object>> toSort=new ArrayList<Map<Object,Object>>(listOfMaps.size());
  toSort.addAll(listOfMaps);
  try {
    MapComparator mc=new MapComparator(sortKeys);
    Collections.sort(toSort,mc);
  }
 catch (  Exception e) {
    Debug.logError(e,"Problems sorting list of maps; returning null.",module);
    return null;
  }
  return toSort;
}

public static List < Map < Object , Object > > sortMaps ( List < Map < Object , Object > > listOfMaps , List < ? extends String > sortKeys ) { if ( listOfMaps == null || sortKeys == null ) return null ; List < Map < Object , Object > > toSort = new ArrayList < Map < Object , Object > > ( listOfMaps . size ( ) ) ; toSort . addAll ( listOfMaps ) ; try { MapComparator mc = new MapComparator ( sortKeys ) ; Collections . sort ( toSort , mc ) ; } catch ( Exception e ) { Debug . logError ( e , "Problems sorting list of maps; returning null." , module ) ; return null ; } return toSort ; }
sort a list of maps by specified consistent keys .
