#!/usr/bin/env python
import coral ; metamodel=coral.lang.UML14

m1 = metamodel.Model()
m2 = metamodel.Model()

c1 = metamodel.Class()
c2 = metamodel.Class()
c3 = metamodel.Class()
c4 = metamodel.Class()

m1.ownedElement = [c1,c2,c3,c4]
m2.ownedElement = m1.ownedElement

m2.name = "hej"
m1.name = m2.name
assert m1.name == "hej" 

assert m1.ownedElement.size() == 0
assert m2.ownedElement.size() == 4
       
assert m2.ownedElement.getCollection().count(c1) == 1
assert m2.ownedElement.getCollection().count(c2) == 1
assert m2.ownedElement.getCollection().count(c3) == 1
assert m2.ownedElement.getCollection().count(c4) == 1
