@Test public void hashCodeTest() { TtlBucket firstBucket = new TtlBucket(0); TtlBucket secondBucket = new TtlBucket(0); TtlBucket thirdBucket = new TtlBucket(1); Assert.assertEquals(firstBucket.hashCode(), firstBucket.hashCode()); Assert.assertEquals(firstBucket.hashCode(), secondBucket.hashCode()); Assert.assertNotEquals(firstBucket.hashCode(), thirdBucket.hashCode()); }
@Override public int hashCode() { return Objects.hashCode(mTtlIntervalStartTimeMs); }
TtlBucket implements Comparable<TtlBucket> { @Override public int hashCode() { return Objects.hashCode(mTtlIntervalStartTimeMs); } }
TtlBucket implements Comparable<TtlBucket> { @Override public int hashCode() { return Objects.hashCode(mTtlIntervalStartTimeMs); } TtlBucket(long startTimeMs); }
TtlBucket implements Comparable<TtlBucket> { @Override public int hashCode() { return Objects.hashCode(mTtlIntervalStartTimeMs); } TtlBucket(long startTimeMs); long getTtlIntervalStartTimeMs(); long getTtlIntervalEndTimeMs(); static long getTtlIntervalMs(); Collection<Inode> getInodes(); void addInode(Inode inode); void removeInode(InodeView inode); @Override int compareTo(TtlBucket ttlBucket); @Override boolean equals(Object o); @Override int hashCode(); }
TtlBucket implements Comparable<TtlBucket> { @Override public int hashCode() { return Objects.hashCode(mTtlIntervalStartTimeMs); } TtlBucket(long startTimeMs); long getTtlIntervalStartTimeMs(); long getTtlIntervalEndTimeMs(); static long getTtlIntervalMs(); Collection<Inode> getInodes(); void addInode(Inode inode); void removeInode(InodeView inode); @Override int compareTo(TtlBucket ttlBucket); @Override boolean equals(Object o); @Override int hashCode();  }