### Question:
MetricsCache { public Record get(String name, Collection<MetricsTag> tags) { RecordCache rc = map.get(name); if (rc == null) return null; return rc.get(tags); } MetricsCache();  MetricsCache(int maxRecsPerName); Record update(MetricsRecord mr, boolean includingTags); Record update(MetricsRecord mr); Record get(String name, Collection<MetricsTag> tags);  }### Answer:
@SuppressWarnings("deprecation") @Test public void testGet() { MetricsCache cache = new MetricsCache(); assertNull("empty", cache.get("r", Arrays.asList(makeTag("t", "t")))); MetricsRecord mr = makeRecord("r", Arrays.asList(makeTag("t", "t")), Arrays.asList(makeMetric("m", 1))); cache.update(mr); MetricsCache.Record cr = cache.get("r", mr.tags()); LOG.debug("tags="+ mr.tags() +" cr="+ cr); assertNotNull("Got record", cr); assertEquals("contains 1 metric", 1, cr.metrics().size()); checkMetricValue("new metric value", cr, "m", 1); }