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

m = metamodel.Method()

p1 = metamodel.Parameter()
p1.name = "p1"
p2 = metamodel.Parameter()
p2.name = "p2"
p3 = metamodel.Parameter()
p3.name = "p3"

m.parameter.append(p1)
m.parameter.append(p2)
m.parameter.append(p3)

print m.parameter
a = m.parameter[1:2]

print a
assert(len(a) == 1)
assert(a[0] == p2)

m.parameter[0:2] = [p1]
assert(m.parameter[0] == p1)
assert(m.parameter[1] == p3)
assert(len(m.parameter) == 2)
