I have been reading about how best to override the equals method when dealing with subclasses and here I have found quite a few posts. They recommend different ways of implement
The simplest approach is to extend equals() in both the concrete and the abstract classes.
public class ConcreteClassTwo extends ConcreteClassOne {
public boolean equals(Object other) {
boolean rv = super.equals( other );
if ( other instanceof ConcreteClassTwo ) {
rv = rv && (this.trackingNo == ((ConcreteClassTwo) other).trackingNo);
}
return rv;
}
}