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

m = metamodel.Model()
c = metamodel.Class()

m.ownedElement.add(c)
m.ownedElement.add(c)

assert(len(m.ownedElement) == 1)

c.namespace = m

assert(len(m.ownedElement) == 1)
assert(c.namespace == m)

c.namespace = None

assert(len(m.ownedElement) == 0)
assert(c.namespace is None)
