Generate hashCode and equals methods.