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