/**
* Tests the clone() method.
*/
public void testClone() {
ClassElement cloned = (ClassElement) element.clone();
assertEquals(1, cloned.getModelElement().getModelElementListeners().size());
assertTrue(cloned.getModelElement().getModelElementListeners()
.contains(cloned));
assertTrue(cloned.getModelElement() != element.getModelElement());
assertTrue(cloned != element);
assertTrue(cloned.getMainCompartment() != element.getMainCompartment());
assertTrue(cloned.getMainCompartment().getParent() == cloned);
assertTrue(cloned.getAttributesCompartment() !=
element.getAttributesCompartment());
assertTrue(cloned.getAttributesCompartment().getParent() == cloned);
assertTrue(cloned.getOperationsCompartment() !=
element.getOperationsCompartment());
assertTrue(cloned.getOperationsCompartment().getParent() == cloned);
// Tests the main label
assertTrue(cloned.getMainLabel() != element.getMainLabel());
assertEquals(1, cloned.getMainCompartment().getLabels().size());
assertEquals(cloned.getMainLabel(),
cloned.getMainCompartment().getLabels().get(0));
assertTrue(cloned.getMainCompartment() == cloned.getMainLabel().getParent());
assertTrue(cloned == cloned.getMainLabel().getSource());
}