MetricName { @Override public int hashCode() { int result = hashCode; if (result == 0) { result = name.hashCode(); result = 31 * result + tags.hashCode(); hashCode = result; } return result; } private  MetricName(String name, LinkedHashMap<String, String> tags); @JsonCreator private  MetricName(@JsonProperty("name") String name, @JsonProperty("tags") Map<String, String> tags); MetricName withTag(String key, String value); static Builder name(String name); String getName(); Map<String, String> getTags(); @JsonIgnore List<String> getTagKeys(); @JsonIgnore List<String> getTagValues(); String toGraphiteName(); @Override boolean equals(Object o); @Override int hashCode(); boolean matches(MetricName other); @Override String toString();  }
@Test public void testHashCode() { assertEquals(name("foo").tag("bar", "baz").tag("qux", "quux").build().hashCode(), name("foo").tag("bar", "baz").tag("qux", "quux").build().hashCode()); assertEquals(name("foo").tag("qux", "quux").tag("bar", "baz").build().hashCode(), name("foo").tag("bar", "baz").tag("qux", "quux").build().hashCode()); }