RouterLevelHistogram extends HashMap<String, Float> { public static RouterLevelHistogram makeMedianHistogram(final Histogram histogram) { final RouterLevelHistogram rlh = new RouterLevelHistogram(); for (Map.Entry<String, Map<Integer, Float>> accessPoint : histogram.entrySet()) { rlh.put(accessPoint.getKey(), calculateMedianLevel(accessPoint.getValue())); } return rlh; } RouterLevelHistogram(final RouterLevelHistogram rlh);  RouterLevelHistogram(); int intersect(final RouterLevelHistogram rlh); static RouterLevelHistogram makeMedianHistogram(final Histogram histogram); static RouterLevelHistogram makeAverageHistogram(final Histogram histogram); static RouterLevelHistogram makeNormalizedHistogram(final RouterLevelHistogram histogram);  }
@Test public void testMedianFactory() { RouterLevelHistogram rlh = RouterLevelHistogram.makeMedianHistogram(histogram); assertEquals(3, rlh.size()); assertEquals(-21.5f, rlh.get("00:01:02:03:04:05"), 0.00001); assertEquals(-42f, rlh.get("a0:b0:c0:d0:e0:f0"), 0.00001); assertEquals(-35f, rlh.get("01:23:45:67:89:ab"), 0.00001); }