public static Status getSummaryStatus(Map<String, Status> statuses) {
        Level level = Level.OK;
        StringBuilder msg = new StringBuilder();
        for (Map.Entry<String, Status> entry : statuses.entrySet()) {
            String key = entry.getKey();
            Status status = entry.getValue();
            Level l = status.getLevel();
            if (Level.ERROR.equals(l)) {
                level = Level.ERROR;
                if (msg.length() > 0) {
                    msg.append(',');
                }
                msg.append(key);
            } else if (Level.WARN.equals(l)) {
                if (!Level.ERROR.equals(level)) {
                    level = Level.WARN;
                }
                if (msg.length() > 0) {
                    msg.append(',');
                }
                msg.append(key);
            }
        }
        return new Status(level, msg.toString());
    }
@Test
    void testGetSummaryStatus2() throws Exception {
        Status status1 = new Status(Status.Level.WARN);
        Status status2 = new Status(Status.Level.OK);
        Map<String, Status> statuses = new HashMap<String, Status>();
        statuses.put("status1", status1);
        statuses.put("status2", status2);
        Status status = StatusUtils.getSummaryStatus(statuses);
        assertThat(status.getLevel(), is(Status.Level.WARN));
        assertThat(status.getMessage(), containsString("status1"));
        assertThat(status.getMessage(), not(containsString("status2")));
    }