class AlarmService {

    public Alarm searchAlarm(final Alarm alarm) {

        Collection<Alarm> identicalAlarms =
            searchAlarmsBySourceTargetAndThresholds(alarm.getGraphiteBaseUrl(), alarm.getTarget(), alarm.getWarn(), alarm.getError());

        if (!identicalAlarms.isEmpty()) {
            return identicalAlarms.iterator().next();
        }

        return null;
    }

}