### Question:
ColumnIdentifier implements Comparable<ColumnIdentifier>, Serializable { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((columnIdentifier == null) ? 0 : columnIdentifier.hashCode()); result = prime * result + ((tableIdentifier == null) ? 0 : tableIdentifier.hashCode()); return result; } ColumnIdentifier();  ColumnIdentifier(String tableIdentifier, String columnIdentifier); String getTableIdentifier(); void setTableIdentifier(String tableIdentifier); String getColumnIdentifier(); void setColumnIdentifier(String columnIdentifier); @Override String toString(); String toString(Map<String, String> tableMapping, Map<String, String> columnMapping); static ColumnIdentifier fromString(Map<String, String> tableMapping, Map<String, String> columnMapping, String str); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(ColumnIdentifier other); static final String TABLE_COLUMN_CONCATENATOR; static final String TABLE_COLUMN_CONCATENATOR_ESC; }### Answer:
@Test public void testEqualsEqual() { String tableIdentifier1 = "table1"; String columnIdentifier1 = "column1"; ColumnIdentifier identifier1 = new ColumnIdentifier(tableIdentifier1, columnIdentifier1); ColumnIdentifier identifier2 = new ColumnIdentifier(tableIdentifier1, columnIdentifier1); assertEquals(identifier1, identifier2); assertEquals(identifier1.hashCode(), identifier2.hashCode()); }
@Test public void testEqualsNotEqualValues() { String tableIdentifier1 = "table1"; String columnIdentifier1 = "column1"; ColumnIdentifier identifier1 = new ColumnIdentifier(tableIdentifier1, columnIdentifier1); String tableIdentifier2 = "table2"; String columnIdentifier2 = "column2"; ColumnIdentifier identifier2 = new ColumnIdentifier(tableIdentifier2, columnIdentifier2); ColumnIdentifier identifier3 = new ColumnIdentifier(tableIdentifier1, columnIdentifier2); assertNotEquals(identifier1, identifier2); assertNotEquals(identifier1.hashCode(), identifier2.hashCode()); assertNotEquals(identifier2, identifier3); assertNotEquals(identifier2.hashCode(), identifier3.hashCode()); }
@Test public void testEqualsContainingNull() { String tableIdentifier1 = "table1"; String columnIdentifier1 = "column1"; ColumnIdentifier identifier1 = new ColumnIdentifier(tableIdentifier1, columnIdentifier1); ColumnIdentifier identifierNull1 = new ColumnIdentifier(tableIdentifier1, null); ColumnIdentifier identifierNull2 = new ColumnIdentifier(tableIdentifier1, null); ColumnIdentifier identifierNull3 = new ColumnIdentifier(null, columnIdentifier1); ColumnIdentifier identifierNull4 = new ColumnIdentifier(null, columnIdentifier1); assertNotEquals(identifierNull1, identifier1); assertNotEquals(identifierNull1.hashCode(), identifier1.hashCode()); assertEquals(identifierNull1, identifierNull2); assertNotEquals(identifierNull3, identifier1); assertNotEquals(identifierNull3.hashCode(), identifier1.hashCode()); assertEquals(identifierNull3, identifierNull4); }