@Test
public void testMetricName() {

    MetricName n1 = metrics.metricName("name", "group", "description", "key1", "value1", "key2", "value2");
    Map<String, String> tags = new HashMap<String, String>();
    tags.put("key1", "value1");
    tags.put("key2", "value2");
    MetricName n2 = metrics.metricName("name", "group", "description", tags);
    assertEquals("metric names created in two different ways should be equal", n1, n2);
    try {
        metrics.metricName("name", "group", "description", "key1");
        fail("Creating MetricName with an odd number of keyValue should fail");
    } catch (IllegalArgumentException e) {
        // this is expected
    }
}