@Test public void equals() { TtlBucket firstBucket = new TtlBucket(0); TtlBucket secondBucket = new TtlBucket(0); TtlBucket thirdBucket = new TtlBucket(1); Assert.assertNotEquals(firstBucket, null); Assert.assertEquals(firstBucket, firstBucket); Assert.assertEquals(firstBucket, secondBucket); Assert.assertEquals(secondBucket, firstBucket); Assert.assertNotEquals(firstBucket, thirdBucket); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TtlBucket)) { return false; } TtlBucket that = (TtlBucket) o; return mTtlIntervalStartTimeMs == that.mTtlIntervalStartTimeMs; }
TtlBucket implements Comparable<TtlBucket> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TtlBucket)) { return false; } TtlBucket that = (TtlBucket) o; return mTtlIntervalStartTimeMs == that.mTtlIntervalStartTimeMs; } }
TtlBucket implements Comparable<TtlBucket> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TtlBucket)) { return false; } TtlBucket that = (TtlBucket) o; return mTtlIntervalStartTimeMs == that.mTtlIntervalStartTimeMs; } TtlBucket(long startTimeMs); }
TtlBucket implements Comparable<TtlBucket> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TtlBucket)) { return false; } TtlBucket that = (TtlBucket) o; return mTtlIntervalStartTimeMs == that.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 boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TtlBucket)) { return false; } TtlBucket that = (TtlBucket) o; return mTtlIntervalStartTimeMs == that.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();  }