}
@Test
public void testEquality() throws InvalidDDMSException {
for (String sVersion : getSupportedVersions()) {
DDMSVersion version = DDMSVersion.setCurrentVersion(sVersion);
// Base equality
Type elementComponent = getInstance(getValidElement(sVersion), SUCCESS);
Type builderComponent = new Type.Builder(elementComponent).commit();
assertEquals(elementComponent, builderComponent);
assertEquals(elementComponent.hashCode(), builderComponent.hashCode());
// Different values in each field
Type.Builder builder = getBaseBuilder();
builder.setQualifier(DIFFERENT_VALUE);
assertFalse(elementComponent.equals(builder.commit()));
builder = getBaseBuilder();
builder.setValue(DIFFERENT_VALUE);
assertFalse(elementComponent.equals(builder.commit()));
if (version.isAtLeast("4.0.1")) {
builder = getBaseBuilder();
builder.setDescription(DIFFERENT_VALUE);
assertFalse(elementComponent.equals(builder.commit()));
}
}