Peter Haggar says:
‘A quick glance through the source code of the Java libraries
shows the use of instanceof in
equals method implementations is common.
You also find the use of getClass.
The Java libraries are not consistent in how they implement the
equals
methods of their classes,
thereby making consistent equality comparisons difficult’.