title: Dynamically adding elements to ArrayList in Groovy
body: <p>I am new to Groovy and, despite reading many articles and questions about this, I am still not clear of what is going on.
  From what I understood so far, when you create a new array in Groovy, the underlying type is a Java ArrayList. This means that it should be resizable, you should be able to initialize it as empty and then dynamically add elements through the add method, like so:</p>
  
  <pre><code>MyType[] list = []
  list.add(new MyType(...))
  </code></pre>
  
  <p>This compiles, however it fails at runtime: No signature of method: [LMyType;.add() is applicable for argument types: (MyType) values: [MyType@383bfa16]</p>
  
  <p>What is the proper way or the proper type to do this?</p>