@Test
public void testCompareTo() {

    final MetricName a = MetricName.EMPTY.tagged("foo", "bar");
    final MetricName b = MetricName.EMPTY.tagged("foo", "baz");
    assertThat(a.compareTo(b)).isLessThan(0);
    assertThat(b.compareTo(a)).isGreaterThan(0);
    assertThat(b.compareTo(b)).isEqualTo(0);
    assertThat(b.resolve("key").compareTo(b)).isLessThan(0);
    assertThat(b.compareTo(b.resolve("key"))).isGreaterThan(0);
}