title: Drools: how to iterate list and add to another list
body: <p>I am trying to iterate a ArrayList and add to another ArrayList using jboss drools inside the rule.</p>
  
  <p>I have a pojo with the list.</p>
  
  <pre><code>Class DroolsPojo{
     List&lt;String&gt; answers;
  
     //getters and setters
  }
  </code></pre>
  
  <p>My pojo returning a list like {"a","b","c","","",""}. I want to iterate the list and want to add elements which are not equal to ""(not empty elements of the list).</p>
  
  <p>How can I do this with drools?</p>
  
  <p>Is there any way to get the element count which is not equal to "" with the drools.</p>
  
  <p>My rule is like as follows.</p>
  
  <pre><code>rule "rule1"
  when 
     dpojo:DroolsPojo(answers!=null)
  then
      List list = dpojo.getAnswers();
      //want to iterate the list here
  end
  </code></pre>
  
  <p>How to do this with drools?</p>