SVGServiceGraphGenerator { protected static Severity getAverageSeverity(Severity[] severities) { Severity ret=Severity.Normal; int sum=0; for (Severity s : severities) { sum = s.ordinal(); } if (sum > 0) { float result=sum / severities.length; ret = Severity.values()[Math.round(result)]; } return (ret); } SVGServiceGraphGenerator(); SeverityAnalyzer getSeverityAnalyzer(); void setSeverityAnalyzer(SeverityAnalyzer analyzer); void generate(ServiceGraph sg, int maxWidth, java.io.OutputStream os);  }
@Test public void testAverageSeverity() { Severity[] severities={ Severity.Normal, Severity.Critical }; Severity avg=SVGServiceGraphGenerator.getAverageSeverity(severities); if (avg == null) { fail("Average is null"); } if (avg != Severity.Warning) { fail("Average should be Warning: "+avg); } }