@Test public void testEqualsObject() { assertTrue("Wrong hashCode implementation, same users have NOT same hash-code ", leOne.hashCode() == leOne.hashCode()); assertFalse("Wrong hashCode implementation, different users have same hash-code", leOne.hashCode() == leThree.hashCode()); assertTrue("Wrong hashCode implementation, same users have NOT same hash-code ", leOne.hashCode() == sameAsLeOne.hashCode()); }
@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);  }