title: Foreach with JSONArray and JSONObject
body: <p>I'm using <code>org.json.simple.JSONArray</code> and <code>org.json.simple.JSONObject</code>. I know that these two classes <code>JSONArray</code> and <code>JSONObject</code> are incompatible, but still I want to do quite a natural thing - I want to for-each over <code>JSONArray</code> parsing at each iteration step one <code>JSONObject</code> (nested inside that <code>JSONArray</code>). I try to do it like so:</p>
  
  <pre><code>JSONArray arr = ...; // &lt;-- got by some procedure
  for(JSONObject o: arr){
      parse(o);
  }
  </code></pre>
  
  <p>When I try to compile this code, indeed I get "incompatible types" error, even though it looks so natural. So, my question is what is the best way to iterate through <code>JSONArray</code>?</p>