class RolledUpMonitoredService implements MonitoredService {

    public ServiceStatus getServiceStatus() {
        List<String> reasons = new ArrayList<String>();

        Status criticalStatus = Status.UP;

        for (MonitoredService m : criticals) {
            ServiceStatus serviceStatus = m.getServiceStatus();
            Status status = serviceStatus.getStatus();

            if (statusIsNotUp(status)) {
                for (String reason : serviceStatus.getReasons()) {
                    reasons.add(serviceStatus.getName() + ":" + reason);
                }
            }

            if (status.getValue() < criticalStatus.getValue()) {
                criticalStatus = status;
            }
        }

        Status result = Status.UP;

        for (MonitoredService m : noncriticals) {
            ServiceStatus serviceStatus = m.getServiceStatus();
            Status status = serviceStatus.getStatus();

            if (statusIsNotUp(status)) {
                for (String reason : serviceStatus.getReasons()) {
                    reasons.add(serviceStatus.getName() + ":" + reason);
                }
                result = Status.DEGRADED;
            }
        }

        if (criticalStatus.getValue() < result.getValue()) {
            result = criticalStatus;
        }

        return new ServiceStatus(name, result, reasons);
    }

    public  RolledUpMonitoredService(String name,
            Collection<? extends MonitoredService> criticals,
            Collection<? extends MonitoredService> noncriticals);

}