title: How to efficiently remove all null elements from a ArrayList or String Array?
body: <p>I try with a loop like that</p>
  <pre><code>// ArrayList tourists
  
  for (Tourist t : tourists) {
      if (t != null) {     
          t.setId(idForm); 
      }   
  }
  </code></pre>
  <p>But it isn't nice. Can anyone suggest me a better solution?</p>
  <hr />
  <p>Some useful benchmarks to make better decision:</p>
  <p><a href="http://www.mkyong.com/java/while-loop-for-loop-and-iterator-performance-test-java/" rel="noreferrer">While loop, For loop and Iterator Performance Test</a></p>