title: How to check if JSON object is empty in Java?
body: <p>In Java, if I use the following <code>JSON</code> string as an example, how would I check if the objects are <strong>empty/null</strong>?</p>
  
  <pre><code>{"null_object_1" : [], "null_object_2" : [null] }
  </code></pre>
  
  <p><strong>I have tried using:</strong></p>
  
  <pre><code>if(!jsonSource.isNull("null_object_1"))  {/*null_object_1 is not empty/null*/}
  if(!jsonSource.isNull("null_object_2"))  {/*null_object_2 is not empty/null*/}
  </code></pre>
  
  <p>But these <code>IF</code> statements still return true (as if they are not empty/null).</p>
  
  <p>Does anyone have a solution?</p>
  
  <p><strong>Edit:</strong>
  By "object", I actually meant <code>array</code>.</p>