Generating hashCode and equals