title: Get the list from Map and filter using groovy
body: <p>I am trying to get a list from a map and based on id's list and want to retrieve the values (list) based on age (age > 35) </p>
  
  <pre><code>def people = [
  "1": [[name:'Bob', age: 32, gender: 'M'],[name:'Johnny', age: 36, gender: 'M']],
  "3": [[name:'Claire', age: 21, gender: 'F'],[name:'Amy', age: 54, gender:'F']],
  "4": [[name:'John', age: 41, gender: 'F'],[name:'Sam', age: 54, gender:'F']]
  ]
  
  def id = ["1","3"]
  
  
  def age = people.subMap(id).values().findAll{it.age &gt; 35}
  </code></pre>
  
  <p>However, i am getting the below error:</p>
  
  <pre><code>Cannot compare java.util.ArrayList with value '[32, 36]' and java.lang.Integer with value '35'
  </code></pre>
  
  <p>How can I get the list of all persons whose age is > 35?</p>