title: Why an immutable class is mutable in Groovy?
body: <p>Reading the "The Well-Grounded Java Developer" book by Benjamin J. Evans and Martijn Verburg I've encountered the following example in Groovy:</p>
  
  <pre><code>class Character {
      private int strength
      private int wisdom
  }
  
  def pc = new Character(strength: 10, wisdom: 15)
  pc.strength = 18
  println "STR [" + pc.strength + "] WIS [" + pc.wisdom + "]"
  </code></pre>
  
  <p>The output of the snippet is the following:</p>
  
  <pre><code>STR [18] WIS [15]
  </code></pre>
  
  <p>Till now there is no questions. The code above have been slightly modified with the <code>@Immutable</code> annotation, as the book suggests:</p>
  
  <pre><code>import groovy.transform.*
  
  @Immutable
  class Character {
      private int strength
      private int wisdom
  }
  
  def pc = new Character(strength: 10, wisdom: 15)
  
  pc.strength = 18
  
  println "STR [" + pc.strength + "] WIS [" + pc.wisdom + "]"
  </code></pre>
  
  <p>The output of the last snippet is still the same:</p>
  
  <pre><code>STR [18] WIS [15]
  </code></pre>
  
  <p>The expected result is anything but not like the one above... </p>
  
  <p><em>Why does an object of an immutable class seem to act like a mutable one? Does conception of immutability in Groovy permit modification to class fields?</em></p>