class AlertService {

    public List<Stat> getStatNoTypeChange(final String from) {
        final Collection<Alert> alerts = this.getAlerts(from);

        final Stat.StatBuilder stat = new Stat.StatBuilder();

        for (final Alert a : alerts) {
            if (a.getFromType() == a.getToType()) {
                stat.increment(a.getAlarmId(), a.getToType());
            } else {
                stat.removeAndIgnore(a.getAlarmId());
            }
        }

        return stat.build();
    }

}