AbstractExpression implements Expression<T>, Serializable, PortableObject { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AbstractExpression that = (AbstractExpression) o; return expression.equals(that.expression); } protected  AbstractExpression(); protected  AbstractExpression(String expression); protected  AbstractExpression(InputStream expression); T evaluate(Object target); void readExternal(PofReader reader); void writeExternal(PofWriter writer); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() { Expression ex = createExpression("address.city"); assertTrue(ex.equals(ex)); assertFalse(ex.equals(null)); assertFalse(ex.equals("blah")); }