Java之所有对象的公用方法>8.Obey the general contract when overriding equals

Overriding the equals method seems simple, but there are many ways to get it wrong, and consequences can be dire.

The easiest way to avoid problems is not to override the equals method, in which case each instance of the class is equal only to itself.