/** lists with same elements are equal and have same hashCode */ public void testEquals() { List a = populatedArray(3); List b = populatedArray(3); assertTrue(a.equals(b)); assertTrue(b.equals(a)); assertEquals(a.hashCode(), b.hashCode()); a.add(m1); assertFalse(a.equals(b)); assertFalse(b.equals(a)); b.add(m1); assertTrue(a.equals(b)); assertTrue(b.equals(a)); assertEquals(a.hashCode(), b.hashCode()); }
/** * @return hash code of the instance * @author Klaus Meffert * @since 2.3 */ public int hashCode() { if (m_data.size() == 0) { return -29; } else { return m_data.hashCode(); } }
public int hashCode() { return pred.hashCode() + ((coartRels != null) ? coartRels.hashCode() : 0); }
public int hashCode() { return _a.hashCode(); }