title: Create a new Map <String, List<String>> with selective elements from another Map <String, List<String>>
body: <p>Am trying to create a new <code>Map &lt;String, List&lt;String&gt;&gt; headErrors</code> with selective elements from another <code>Map &lt;String, List&lt;String&gt;&gt; invoiceErrorLines</code></p>
  
  <pre><code>invoiceErrorLines = ['1660277':['Line : 1 Invoice does not foot Reported', 'Line : 2 MATH ERROR'], 
                      '1660278':['Line : 5 Invoice does not foot Reported', 'cl_id is a required field'], 
                      '1660279':['Line : 7 could not parse date ', 'File Error : The file doesnt have delimiter'], 
                      '1660280':['Line : 9 Invoice error']]
  def regex = "^Line\\s(?:(\\d+)\\s)?\\s*:\\s+(\\d+)?.+"
  def headErrors = invoiceErrorLines.each{ inv -&gt;
     inv.value.findAll{it.contains('Invoice does not foot Reported') || !(it ==~ regex) }.groupBy{inv.key} 
  }
  </code></pre>
  
  <p>New Map should contain invoice numbers as key and its corresponding error messages which doesnt match <code>regex = "^Line\\s(?:(\\d+)\\s)?\\s*:\\s+(\\d+)?.+"</code> but contains <code>Invoice does not foot Reported</code></p>
  
  <p>When I print <code>headErrors</code> am seeing the same map as <code>invoiceErrorLines</code> but
  am expecting the <code>headErrors</code> as below</p>
  
  <pre><code>headErrors = ['1660277':['Line : 1 Invoice does not foot Reported'], 
                '1660278':['Line : 5 Invoice does not foot Reported', 'cl_id is a required field'], 
                '1660279':['File Error : The file doesnt have delimiter'] 
               ]
  </code></pre>
  
  <p>Can someone help me with this?</p>