Either this needs to use an `instanceof` check and make equals/hashCode final *or* the class needs to be final to guarantee proper equality semantics.