title: Why the 'each' loop does not run when the array is empty
body: <p>I have a script assertion that should just spot check each item in the response and check that each item is the correct data type.
  I noticed that when the response is empty the each loop does not seem to run, therefore the assertion passes where it should not.</p>
  
  <p>Rule ID is a field in the response, but when the request criteria does not match any deal, it will return an empty array. </p>
  
  <p>Is this the correct behaviour for an each loop? If so what would be the best loop to use? </p>
  
  <p>Code below and Thanks in advance</p>
  
  <p>added this Groovy snippet</p>
  
  <pre><code>import groovy.json.JsonSlurper
  def slurper = new JsonSlurper()
  def response = context.expand( '${POST/instant-deal/get-applicable-request#Response}' ).toString()
  def jsonRes = slurper.parseText(response)
  
  RuleId = jsonRes.RuleId
  RuleId.each { RuleID -&gt;
      log.error "Rule IDs: " + RuleID
      assert RuleID != null
      assert RuleID instanceof Integer    
  }
  </code></pre>