SyntaxFix
Write A Post
Hire A Developer
Questions
The Groovy way to do this is
def list = [] list << new MyType(...)
which creates a list and uses the overloaded leftShift operator to append an item
leftShift
See the Groovy docs on Lists for lots of examples.