title: Update map using findAll and each in groovy
body: <p>I would like to update values in map in Groovy filling certain criteria. Here is my code:</p>
  
  <pre><code>def m = [:]
  m['a'] = 1
  m['b'] = 2
  m['d'] = 3
  m.findAll { it.value &gt; 1}.each { 
  it.value = 4
  }
  println m
  </code></pre>
  
  <p>But the result is following:</p>
  
  <pre><code>[a:1, b:2, d:3]
  </code></pre>
  
  <p>Is there any way to do it using both findAll and each? Or I must use </p>
  
  <pre><code>m.each {if (it.value&gt;1) it.value=4}
  </code></pre>