title: JSON - parsing document with JSONArray in Java
body: <p>I'm parsing this document:
  <a href="http://pastebin.com/M3Gsbf1t" rel="nofollow">http://pastebin.com/M3Gsbf1t</a>
  as you can see it's kind of big. This document was generated by Youtube Data API v3.
  I want to get all "title" elements and display them.
  My code:</p>
  
  <pre><code>Object obj = parser.parse(str); // str contains the JSON code
  JSONObject jsonObject = (JSONObject) obj;               
  JSONArray msg = (JSONArray) jsonObject.get("title");
  Iterator iterator = msg.iterator();
  while (iterator.hasNext()) {
    System.out.println(iterator.next());
  }
  </code></pre>
  
  <p>but it returns "NullPointerException".
  If I replace the "title" with the "items" it works fine but it returns me a lot of informations that I don't need. 
  I'm using the JSON.simple library. </p>
  
  <p>Thanks for help :)</p>