title: Could you print the variable name in a Groovy list and not the value
body: <p>If I got a list in Groovy containing 2 or more variables with some value, and I want to see if it contains a given text string I'm doing the following:</p>
  
  <pre><code>def msg = '''
   Hello Mars!
  '''
  
  def msg1 = '''
   Hello world!
  '''
  
  
  def list = [msg, msg1]
  
  list.findAll { w -&gt; 
      if(w.contains("Hello"))
      {
          println w
      }
      else
      {
          println "Not there"
      }
  }
  </code></pre>
  
  <p>But instead of printing the value I would like to print the variable name that contains the text. Is that possible with a list or do I need to make a map? </p>