for (Rule rule : rules) {
List<RuleAlertRelation> ruleAlertRelations = ruleAlertRelationDao.findAllByRule(rule.getId());
List<Alert> alerts = new ArrayList<>(ruleAlertRelations.size());
for (RuleAlertRelation ruleAlertRelation : ruleAlertRelations) {
Alert alert = alertDao.find(ruleAlertRelation.getAlertId());
alerts.add(alert);
failCountByAlertIdAndRuleIdConcatenation.put(
String.valueOf(alert.getId()) + '#' + rule.getId(),
String.valueOf(ruleAlertRelation.getMaxConsecutiveFailCount()));
}
alertsByRuleId.put(String.valueOf(rule.getId()), alerts);
}