@Test public void testHashCode() throws Exception { DeleteOperation op1 = new DeleteOperation(new CacheEntry(OUR_KEY, new Element(OUR_KEY, "someValue"))); DeleteOperation op2 = new DeleteOperation(new CacheEntry(OUR_KEY, new Element(OUR_KEY, "someOtherValue"))); assertThat("A Delete operation should have the same hashCode as its key", op1.hashCode(), is(OUR_KEY.hashCode())); assertThat("Delete operations for the same key, should have the same hashCode", op1.hashCode(), is(op2.hashCode())); }
@Override public int hashCode() { return entry.getKey().hashCode(); }
DeleteOperation implements SingleOperation { @Override public int hashCode() { return entry.getKey().hashCode(); } }
DeleteOperation implements SingleOperation { @Override public int hashCode() { return entry.getKey().hashCode(); } DeleteOperation(CacheEntry entry);  DeleteOperation(CacheEntry entry, long creationTime); }
DeleteOperation implements SingleOperation { @Override public int hashCode() { return entry.getKey().hashCode(); } DeleteOperation(CacheEntry entry);  DeleteOperation(CacheEntry entry, long creationTime); void performSingleOperation(CacheWriter cacheWriter); BatchOperation createBatchOperation(List<SingleOperation> operations); Object getKey(); long getCreationTime(); CacheEntry getEntry(); SingleOperationType getType(); @Override boolean equals(final Object o); @Override int hashCode(); }
DeleteOperation implements SingleOperation { @Override public int hashCode() { return entry.getKey().hashCode(); } DeleteOperation(CacheEntry entry);  DeleteOperation(CacheEntry entry, long creationTime); void performSingleOperation(CacheWriter cacheWriter); BatchOperation createBatchOperation(List<SingleOperation> operations); Object getKey(); long getCreationTime(); CacheEntry getEntry(); SingleOperationType getType(); @Override boolean equals(final Object o); @Override int hashCode();  }