### Question:
TableDesc { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TableDesc other = (TableDesc) obj; return key.equals(other.key); }  String getCatalogName(); void setCatalogName(String catalogName); String getSchemaName(); void setSchemaName(String schemaName); String getName(); void setName(String name); String getFullName(); String getCanonicalName(); void setCanonicalName(String canonicalName); String getComment(); void setComment(String comment); List<ColumnDesc> getColumnDescList(); void addColumnDesc(ColumnDesc columnDesc); PrimaryKeyDesc getPrimaryKeyDesc(); void setPrimaryKeyDesc(PrimaryKeyDesc primaryKeyDesc); List<ForeignKeyDesc> getForeignKeyDescList(); void addForeignKeyDesc(ForeignKeyDesc foreignKeyDesc); List<UniqueKeyDesc> getUniqueKeyDescList(); void addUniqueKeyDesc(UniqueKeyDesc uniqueKeyDesc); List<SequenceDesc> getSequenceDescList(); void addSequenceDesc(SequenceDesc sequenceDesc); List<TableDesc> getIdTableDescList(); void addIdTableDesc(TableDesc idTableDesc); ColumnDesc getColumnDesc(String columnName); boolean hasIdentityColumn(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testEquals() throws Exception { TableDesc tableDesc = new TableDesc(); tableDesc.setCanonicalName("aaa.bbb.ccc"); TableDesc tableDesc2 = new TableDesc(); tableDesc2.setCanonicalName("aaa.bbb.ccc"); TableDesc tableDesc3 = new TableDesc(); tableDesc3.setCanonicalName("aaa.bbb.ddd"); assertEquals(tableDesc, tableDesc2); assertEquals(tableDesc.hashCode(), tableDesc2.hashCode()); Assert.assertNotEquals(tableDesc, tableDesc3); Assert.assertNotEquals(tableDesc.hashCode(), tableDesc3.hashCode()); }