why we override equals and hashcode method in java example