private List<ProtectionSystem> sortProtectionSystems(Set<ProtectionSystem> protectionSystems){
  List<ProtectionSystem> protectionSystemsLst=new ArrayList<ProtectionSystem>(protectionSystems);
  if (protectionSystems.size() > 1) {
    _log.info("Sorting candidate protection systems by CG last created time.");
    _log.info("Before sort: " + protectionSystemsToString(protectionSystems));
    ProtectionSystemComparator comparator=new ProtectionSystemComparator();
    Collections.sort(protectionSystemsLst,comparator);
    _log.info("After sort: " + protectionSystemsToString(protectionSystemsLst));
  }
  return protectionSystemsLst;
}

private List < ProtectionSystem > sortProtectionSystems ( Set < ProtectionSystem > protectionSystems ) { List < ProtectionSystem > protectionSystemsLst = new ArrayList < ProtectionSystem > ( protectionSystems ) ; if ( protectionSystems . size ( ) > 1 ) { _log . info ( "Sorting candidate protection systems by CG last created time." ) ; _log . info ( "Before sort: " + protectionSystemsToString ( protectionSystems ) ) ; ProtectionSystemComparator comparator = new ProtectionSystemComparator ( ) ; Collections . sort ( protectionSystemsLst , comparator ) ; _log . info ( "After sort: " + protectionSystemsToString ( protectionSystemsLst ) ) ; } return protectionSystemsLst ; }
sorts the set of protectionsystem objects by the cglastcreatedtime field . objects will be sorted from oldest to most current time stamp . the set will also be converted to a list because of the use of a comparator .
