}
// Javadoc inherited.
public void testEqualsAndHashcodeImplementedCorrectly() {
MutableChoiceValue choiceValue1 = createMutableChoiceValueForTestingEquals();
MutableChoiceValue choiceValue2 = createMutableChoiceValueForTestingEquals();
// test that both the values are equal and they have the same hash codes
assertEquals("Object 1 should be equal to object 2", choiceValue1,
choiceValue2);
MetaDataTestCaseHelper.ensureHashcodesEqual(choiceValue1, choiceValue2);
// change the value
final MutableNumberValueImpl value = new MutableNumberValueImpl();
value.setValue(new Integer(123));
choiceValue2.setValue(value);
MetaDataTestCaseHelper.assertNotEquals(choiceValue1, choiceValue2);
MetaDataTestCaseHelper.ensureHashcodesNotEqual(choiceValue1, choiceValue2);
// now reset
choiceValue2 = createMutableChoiceValueForTestingEquals();
// change the choice name
choiceValue2.setChoiceName("other");
MetaDataTestCaseHelper.assertNotEquals(choiceValue1, choiceValue2);
MetaDataTestCaseHelper.ensureHashcodesNotEqual(choiceValue1, choiceValue2);
}