blob: b95c77c8f664641e64346b52c216585c7907c9bd [file] [log] [blame]
package groovy
class ArrayParamMethodTest extends GroovyTestCase implements DummyInterface {
void testMethodCall() {
def array = "a b c".split(' ')
assert array.size() == 3
methodWithArrayParam(array)
}
void methodWithArrayParam(String[] args) {
println("first item: ${args[0]}")
// lets turn it into a list
def list = args.toList()
assert list instanceof java.util.List
list[4] = "e"
assert list == ["a", "b", "c", null, "e"]
println("Created list ${list}")
}
}