TaggedValue implements Comparable<TaggedValue> { static TaggedValue taggedValue(Map<String, String> tags, ValueAndTimestamp valueAndTimestamp) { return new AutoValue_TaggedValue(ImmutableSortedMap.copyOf(tags), valueAndTimestamp); }  @Override int compareTo(TaggedValue o); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testComparison() { comparisonTester() .addLesserGroup(taggedValue(ImmutableMap.of(), valueAndTimestamp(simplePrometheusValue(3), null)), taggedValue(ImmutableMap.of(), valueAndTimestamp(simplePrometheusValue(4), 3333L))) .addGreaterGroup(taggedValue(ImmutableMap.of("a", "x"), valueAndTimestamp(simplePrometheusValue(1), null))) .addGreaterGroup(taggedValue(ImmutableMap.of("a", "x", "b", "y"), valueAndTimestamp(simplePrometheusValue(1), null))) .addGreaterGroup(taggedValue(ImmutableMap.of("a", "x", "b", "z"), valueAndTimestamp(simplePrometheusValue(1), null))) .addGreaterGroup(taggedValue(ImmutableMap.of("a", "y", "b", "y"), valueAndTimestamp(simplePrometheusValue(1), null))) .addGreaterGroup(taggedValue(ImmutableMap.of("b", "y"), valueAndTimestamp(simplePrometheusValue(1), null))) .check(); }