MeterId { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MeterId meterId = (MeterId) o; return Objects.equals(name, meterId.name) && type == meterId.type && Objects.equals(tags, meterId.tags); } MeterId(String name, MeterType type, List<MeterTag> tags); String getName(); List<MeterTag> getTags(); MeterType getType(); List<Label> transformTags(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testEquals() { final MeterId meterId1 = new MeterId("test", MeterType.COUNTER, Arrays.asList(new MeterTag("k1", "v1"))); final MeterId meterId2 = new MeterId("test", MeterType.COUNTER, Arrays.asList(new MeterTag("k1", "v1"))); Assert.assertEquals(meterId1, meterId2); }