BucketTimer extends AbstractMonitor<Long> implements Timer, CompositeMonitor<Long>, SpectatorMonitor { @Override public int hashCode() { int result = config.hashCode(); result = 31 * result + timeUnit.hashCode(); result = 31 * result + totalTime.hashCode(); result = 31 * result + Arrays.hashCode(bucketCount); result = 31 * result + overflowCount.hashCode(); result = 31 * result + min.hashCode(); result = 31 * result + max.hashCode(); result = 31 * result + bucketConfig.hashCode(); return result; } BucketTimer(MonitorConfig config, BucketConfig bucketConfig);  BucketTimer(MonitorConfig config, BucketConfig bucketConfig, TimeUnit unit);   BucketTimer(MonitorConfig config, BucketConfig bucketConfig, TimeUnit unit, Clock clock); @Override void initializeSpectator(TagList tags); @Override List<Monitor<?>> getMonitors(); @Override Stopwatch start(); @Override TimeUnit getTimeUnit(); @Override void record(long duration); @Override void record(long duration, TimeUnit unit); @Override Long getValue(int pollerIndex); Long getTotalTime(); Long getCount(int pollerIndex); Long getMin(int pollerIndex); Long getMax(int pollerIndex); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testHashCode() throws Exception { BucketTimer c1 = newInstance("foo"); BucketTimer c2 = newInstance("foo"); assertEquals(c1.hashCode(), c2.hashCode()); c1.record(42); assertNotEquals(c1.hashCode(), c2.hashCode()); c2.record(42); assertEquals(c1.hashCode(), c2.hashCode()); c1.record(11); assertNotEquals(c1.hashCode(), c2.hashCode()); c2.record(11); assertEquals(c1.hashCode(), c2.hashCode()); }