private boolean addNewAlertDefinitions(AlertCluster update, Map<Long, AlertDefinition> mergedDefinitions) {
    boolean hasNew = false;
    for (Map.Entry<Long, AlertDefinition> each : update.alertDefinitions.entrySet()) {
      if (!mergedDefinitions.containsKey(each.getKey())) {
        mergedDefinitions.put(each.getKey(), each.getValue());
        hasNew = true;
      }
    }
    return hasNew;
  }
Add each alert definitions from the update event which are not included in mergedDefinitions
@return true if there was such an alert definition
ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/AlertCluster.java