ColumnReference implements Expression { public boolean equals(Object o) { return o instanceof ColumnReference && compareTo((ColumnReference<T>) o) == 0; } 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 equalsNullIsFalse() { assertFalse(colRef.equals(null)); }
@Test public void equalsSelfIsTrue() { assertTrue(colRef.equals(colRef)); }
@Test public void equalsSameValuesIsTrue() { ColumnReference<Integer> colRef2 = new ColumnReference<Integer>(table, col); assertTrue(colRef.equals(colRef2)); }
@Test public void equalsDifferentColumnIsFalse() { @SuppressWarnings("unchecked") Column<Integer> col2 = mock(Column.class); ColumnReference<Integer> colRef2 = new ColumnReference<Integer>(table, col2); assertFalse(colRef.equals(colRef2)); }
@Test public void differentObjectTypesAreNotEqual() { Expression exp = mock(Expression.class); assertFalse(colRef.equals(exp)); }