Originally posted by Campbell Ritchie:
Remember that instanceof and similar only work for final classes; otherwise use the bit about this.getClass() and other.getClass().
If the itself method is final, you can use instanceof as well, as long as you hardcode the class. After all, if you compare two an object of class A with an object of a subclass of A and vice versa, both will check if the other is an instance of A. Both checks will return true, so symmetry has been achieved.