@Test public void testEquals() throws Exception { UniqueKeyDesc uniqueKeyDesc = new UniqueKeyDesc(); uniqueKeyDesc.addColumnName("AAA"); UniqueKeyDesc uniqueKeyDesc2 = new UniqueKeyDesc(); uniqueKeyDesc2.addColumnName("aaa"); UniqueKeyDesc uniqueKeyDesc3 = new UniqueKeyDesc(); uniqueKeyDesc3.addColumnName("XXX"); assertEquals(uniqueKeyDesc, uniqueKeyDesc2); assertEquals(uniqueKeyDesc.hashCode(), uniqueKeyDesc2.hashCode()); Assert.assertNotEquals(uniqueKeyDesc, uniqueKeyDesc3); Assert.assertNotEquals(uniqueKeyDesc.hashCode(), uniqueKeyDesc3 .hashCode()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final UniqueKeyDesc other = (UniqueKeyDesc) obj; return key.equals(other.key); }
UniqueKeyDesc { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final UniqueKeyDesc other = (UniqueKeyDesc) obj; return key.equals(other.key); } }
UniqueKeyDesc { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final UniqueKeyDesc other = (UniqueKeyDesc) obj; return key.equals(other.key); }  }
UniqueKeyDesc { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final UniqueKeyDesc other = (UniqueKeyDesc) obj; return key.equals(other.key); }  List<String> getColumnNameList(); void addColumnName(String columnName); @Override int hashCode(); @Override boolean equals(Object obj); }
UniqueKeyDesc { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final UniqueKeyDesc other = (UniqueKeyDesc) obj; return key.equals(other.key); }  List<String> getColumnNameList(); void addColumnName(String columnName); @Override int hashCode(); @Override boolean equals(Object obj);  }