The methods to override are equals() and hashCode().