title: Groovy has a size property for Collection?
body: <p>I have written a piece of code where I'm checking the size of an ArrayList like:</p>
  
  <pre><code>[1,2,3].size
  </code></pre>
  
  <p>All works well on Groovy Console and with Grails embedded Tomcat server. But once I deployed this code to Websphere Application Server, I receivec an exception stating </p>
  
  <pre><code>Exception evaluating property 'size' for java.util.ArrayList, Reason: groovy.lang.MissingPropertyException: No such property: size for class: java.lang.Integer.
  </code></pre>
  
  <p>After a while of debugging, testing and plenty of WTFs, I realized that there were parenthesis missing from the method call. The property notation should not work as there's no method <code>getSize()</code> for Collection (it's plain <code>size()</code>) and this all makes sense.</p>
  
  <p>What's puzzling me, is <strong>why does <code>someCollection.size</code> work on Groovy Console and Grails?</strong> </p>
  
  <p>Grails and Groovy Console version is 2.3.6</p>