Bucket { public Map<String, List<Map.Entry<Point, UntypedMetric>>> getValuesByMetricName() { Map<String, List<Map.Entry<Point, UntypedMetric>>> result = new HashMap<>(); for (Map.Entry<Identifier, UntypedMetric> entry : values.entrySet()) { List<Map.Entry<Point, UntypedMetric>> singleMetric; if (result.containsKey(entry.getKey().getName())) { singleMetric = result.get(entry.getKey().getName()); } else { singleMetric = new ArrayList<>(); result.put(entry.getKey().getName(), singleMetric); } singleMetric.add(locationValuePair(entry)); } return result; } Bucket();  Bucket(long fromMillis, long toMillis); Set<Map.Entry<Identifier, UntypedMetric>> entrySet(); Collection<String> getAllMetricNames(); Collection<Map.Entry<Point, UntypedMetric>> getValuesForMetric(String metricName); Map<Point, UntypedMetric> getMapForMetric(String metricName); Map<String, List<Map.Entry<Point, UntypedMetric>>> getValuesByMetricName(); @Override String toString(); long getFromMillis(); long getToMillis();  }
@Test public final void testGetValuesByMetricName() { twoMetricsUniqueDimensions(); Map<String, List<Entry<Point, UntypedMetric>>> values = bucket.getValuesByMetricName(); assertEquals(2, values.size()); assertEquals(4, values.get("nalle").size()); assertEquals(4, values.get("nalle2").size()); }