@Test public void testHashCode() { assertFalse("Wrong equals implementation, different types are recognized as equals ", leOne.equals(new Integer(1))); assertFalse("Wrong equals implementation, different users are recognized as equals ", leOne.equals(leThree)); assertFalse("Wrong equals implementation, null value is recognized as equals ", leOne.equals(null)); assertTrue("Wrong equals implementation, same users are NOT recognized as equals ", leOne.equals(leOne)); assertTrue("Wrong equals implementation, same users are NOT recognized as equals ", leOne.equals(sameAsLeOne)); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((owner == null) ? 0 : owner.hashCode()); return result; }
LockEntry { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((owner == null) ? 0 : owner.hashCode()); return result; } }
LockEntry { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((owner == null) ? 0 : owner.hashCode()); return result; } LockEntry(String key, long lockAquiredTime, OLATPrincipal owner); }
LockEntry { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((owner == null) ? 0 : owner.hashCode()); return result; } LockEntry(String key, long lockAquiredTime, OLATPrincipal owner); long getLockAquiredTime(); OLATPrincipal getOwner(); String getKey(); @Override int hashCode(); @Override boolean equals(Object obj); }
LockEntry { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((key == null) ? 0 : key.hashCode()); result = prime * result + ((owner == null) ? 0 : owner.hashCode()); return result; } LockEntry(String key, long lockAquiredTime, OLATPrincipal owner); long getLockAquiredTime(); OLATPrincipal getOwner(); String getKey(); @Override int hashCode(); @Override boolean equals(Object obj);  }