DistributionCell implements Distribution, MetricCell<DistributionData> { @Override public boolean equals(@Nullable Object object) { if (object instanceof DistributionCell) { DistributionCell distributionCell = (DistributionCell) object; return Objects.equals(dirty, distributionCell.dirty) && Objects.equals(value.get(), distributionCell.value.get()) && Objects.equals(name, distributionCell.name); } return false; } DistributionCell(MetricName name); @Override void reset(); @Override void update(long n); @Override void update(long sum, long count, long min, long max); @Override DirtyState getDirty(); @Override DistributionData getCumulative(); @Override MetricName getName(); @Override boolean equals(@Nullable Object object); @Override int hashCode();  }
@Test public void testEquals() { DistributionCell distributionCell = new DistributionCell(MetricName.named("namespace", "name")); DistributionCell equal = new DistributionCell(MetricName.named("namespace", "name")); Assert.assertEquals(distributionCell, equal); Assert.assertEquals(distributionCell.hashCode(), equal.hashCode()); }