class ExecutionHistoryService {

    void addScenario(ExecutedScenarioWithErrorAndProblemJoin executedScenarioJoin,
                     Map<String, ExecutedScenarioHandlingCountsDTO> qualitiesPerSeverity,
                     String defaultSeverityCode) {
        final String effectiveSeverityCode = (StringUtils.isEmpty(executedScenarioJoin.getSeverity()) ? defaultSeverityCode : executedScenarioJoin.getSeverity());
        if (effectiveSeverityCode != null) { // when no mandatory severity was asked to run => no default severity to find => null
            addScenarioForSeverity(executedScenarioJoin, qualitiesPerSeverity, effectiveSeverityCode);
        }
        addScenarioForSeverity(executedScenarioJoin, qualitiesPerSeverity, Severity.ALL.getCode());
    }

}