class SmartHomeAlertHandler extends BasePlaceMonitorHandler {

   protected void postProcess(SubsystemContext<PlaceMonitorSubsystemModel> context, AlertScratchPad scratch) {
      context.setVariable(VAR_ALERTSCRATCH, scratch);
      final AlertScratchPad newScratch = scratch.copy();
      postProcessors.forEach(postProcessor -> postProcessor.postProcess(context, scratch, newScratch));

      // sort everything by data that isn't a hub offline alert
      List<Map<String,Object>> alerts = new LinkedList<Map<String, Object>>(newScratch.alerts()
         .stream()
         .sorted((SmartHomeAlert thingOne, SmartHomeAlert thingTwo) -> compareSeverity(thingOne, thingTwo)) // sort alerts by their highest severity (lowest ordinal) first.
         .map(SmartHomeAlert::toMap)
         .collect(Collectors.toList())
      );

      context.model().setSmartHomeAlerts(alerts);
   }

   @Inject public  SmartHomeAlertHandler(
      List<AlertGenerator> generators,
      List<AlertPostProcessor> postProcessors
   );

}