### Question:
Interns { public static MetricsTag tag(MetricsInfo info, String value) { return Tags.INSTANCE.cache.add(info, value); }  static MetricsInfo info(String name, String description); static MetricsTag tag(MetricsInfo info, String value); static MetricsTag tag(String name, String description, String value);  }### Answer:
@Test public void testTag() { MetricsTag tag = tag("t", "t desc", "t value"); assertSame("same tag", tag, tag("t", "t desc", "t value")); }
@Test public void testTagOverflow() { MetricsTag t0 = tag("t0", "t desc", "t value"); for (int i = 0; i < MAX_TAG_NAMES + 1; ++i) { tag("t"+ i, "t desc", "t value"); if (i < MAX_TAG_NAMES) { assertSame("t0 still there", t0, tag("t0", "t desc", "t value")); } } assertNotSame("t0 is gone", t0, tag("t0", "t desc", "t value")); MetricsTag t1 = tag("t1", "t desc", "t value"); for (int i = 0; i < MAX_TAG_VALUES; ++i) { tag("t1", "t desc", "t value"+ i); if (i < MAX_TAG_VALUES -1) { assertSame("t1 is still there", t1, tag("t1", "t desc", "t value")); } } assertNotSame("t1 is gone", t1, tag("t1", "t desc", "t value")); }