ColumnReference implements Expression { public int hashCode() { return Objects.hashCode(column, tableReference); } ColumnReference(TableReference tableReference,
                         Column<T> column); void visit(ExpressionVisitor visitor); Class<T> typeConstraint(); Iterable<Expression> children(); int compareTo(Expression e); boolean equals(Object o); int hashCode(); final TableReference tableReference; final Column<T> column; }
@Test public void equalObjectsHaveSameHashCode() { ColumnReference<Integer> colRef2 = new ColumnReference<Integer>(table, col); assertEquals(colRef.hashCode(), colRef2.hashCode()); }
@Test public void hashCodeDoesNotChange() { assertEquals(colRef.hashCode(), colRef.hashCode()); }
@Test public void hashCodeCanVary() { @SuppressWarnings("unchecked") Column<Integer> col2 = mock(Column.class); ColumnReference<Integer> colRef2 = new ColumnReference<Integer>(table, col2); assertNotEquals(colRef.hashCode(), colRef2.hashCode()); }