Adding equals and hashCode methods