Source:
public void testEqualsHashCode() { ColumnIdentifier column11 = new ColumnIdentifier("table1", "column1"); ColumnIdentifier column12 = new ColumnIdentifier("table2", "column2"); ColumnIdentifier column21 = new ColumnIdentifier("table1", "column1"); List<String> conditionValues1 = new LinkedList<>(); conditionValues1.add("a"); conditionValues1.add("b"); List<String> conditionValues2 = new LinkedList<>(); conditionValues2.add("b"); conditionValues2.add("a"); List<String> conditionValues3 = new LinkedList<>(); conditionValues3.add("a"); conditionValues3.add("b"); conditionValues3.add("c"); ColumnCondition columnCondition1 = new ColumnCondition(column11, conditionValues1.toArray(new String[conditionValues1.size()])); ColumnCondition columnConditionEq = new ColumnCondition(column21, conditionValues1.toArray(new String[conditionValues1.size()])); ColumnCondition columnConditionEq2 = new ColumnCondition(column11, conditionValues2.toArray(new String[conditionValues2.size()])); ColumnCondition columnConditionNotEq = new ColumnCondition(column12, conditionValues1.toArray(new String[conditionValues1.size()])); ColumnCondition columnConditionNotEq2 = new ColumnCondition(column11, conditionValues3.toArray(new String[conditionValues3.size()])); assertEquals(columnCondition1.hashCode(), columnCondition1.hashCode()); assertEquals(columnCondition1, columnCondition1); assertNotSame(columnCondition1, columnConditionEq); assertEquals(columnCondition1.hashCode(), columnConditionEq.hashCode()); assertEquals(columnCondition1, columnConditionEq); assertNotSame(columnCondition1, columnConditionEq2); assertEquals(columnCondition1.hashCode(), columnConditionEq2.hashCode()); assertEquals(columnCondition1, columnConditionEq2); assertNotSame(columnCondition1, columnConditionNotEq); assertNotEquals(columnCondition1, columnConditionNotEq); assertNotSame(columnCondition1, columnConditionNotEq2); assertNotEquals(columnCondition1, columnConditionNotEq2); }

Target:
public void testEqualsHashCode() { ColumnIdentifier column11 = new ColumnIdentifier("table1", "column1"); ColumnIdentifier column12 = new ColumnIdentifier("table2", "column2"); ColumnIdentifier column21 = new ColumnIdentifier("table1", "column1"); List<String> conditionValues1 = new LinkedList<>(); conditionValues1.add("a"); conditionValues1.add("b"); List<String> conditionValues2 = new LinkedList<>(); conditionValues2.add("b"); conditionValues2.add("a"); List<String> conditionValues3 = new LinkedList<>(); conditionValues3.add("a"); conditionValues3.add("b"); conditionValues3.add("c"); ColumnCondition columnCondition1 = new ColumnCondition(column11, conditionValues1); ColumnCondition columnConditionEq = new ColumnCondition(column21, conditionValues1); ColumnCondition columnConditionEq2 = new ColumnCondition(column11, conditionValues2); ColumnCondition columnConditionNotEq = new ColumnCondition(column12, conditionValues1); ColumnCondition columnConditionNotEq2 = new ColumnCondition(column11, conditionValues3); EqualsAndHashCodeTester<ColumnCondition> tester = new EqualsAndHashCodeTester<>(); tester.performBasicEqualsAndHashCodeChecks(columnCondition1, columnConditionEq, columnConditionNotEq, columnConditionNotEq2); tester.performBasicEqualsAndHashCodeChecks(columnCondition1, columnConditionEq2); }