Update Overriding equals and hashCode methods in Java