title: Json Comparison Exception : Can't access getJSONArray in java
body: <pre><code> JSON1:
   {
     "array1": [
      {
        "id": "1",
        "Name": "Xytrex Co.",
        "Description": "Industrial Cleaning Supply Company",
        "Account Number": "ABC15797531",
        "Address": {
         "Permanent": {
         "Street": "st.road",
         "pin": "789723"
         },
          "Temporary": {
           "Street": "st.road",
           "pin": "789723"
         }
       }
     },
  
  {
    "id": "2",
    "Name": "Xytrex Co.",
    "Description": "Industrial Cleaning Supply Company",
    "Account Number": "ABC15797531",
    "Address": {
      "Permanent": {
        "Street": "st.road",
        "pin": "789723"
      },
      "Temporary": {
        "pin": "789723"
      }
    }
  }
   ]
   }
  
  JSON2:
  
       {
     "array2": [
       {
        "id": "1",
        "Name": "Xytrex Co.",
        "Description": "Industrial Cleaning Supply Company",
        "Account Number": "ABC15797531",
        "Address": {
          "Permanent": {
            "Street": "st.road",
            "pin": "789723"
          },
          "Temporary": {
            "Street": "st.road",
            "pin": "789723"
          }
        }
     },
  
    {
       "id": "2",
       "Name": "Xytrex Co.",
      "Description": "Industrial Cleaning Supply Company",
      "Account Number": "ABC15797531",
          "Address": {
          "Permanent": {
          "Street": "st.road",
          "pin": "789723"
         },
         "Temporary": {
          "Street": "st.road",
          "pin": "789723"
         }
       }
     }
   ]
   }
  </code></pre>
  
  <p>Code used by me:</p>
  
  <pre><code>package com.company;
  
  import com.google.gson.JsonArray;
  import com.google.gson.JsonObject;
  import org.skyscreamer.jsonassert.JSONAssert;
  import org.skyscreamer.jsonassert.JSONCompareMode;
  import com.google.gson.JsonParser;
  import org.skyscreamer.jsonassert.JSONCompareMode;
  
  import java.io.FileNotFoundException;
  import java.io.FileReader;
  
  
  public class Main {
  
  public static void main(String[] args) throws FileNotFoundException {
  
      Main cmp = new Main();
      cmp.myTest();
  }
  
  public void myTest() throws FileNotFoundException {
  
       JsonParser Parser = new JsonParser();
       JsonObject obj1 = (JsonObject) Parser.parse(new 
   FileReader("/home/cloudera/Desktop/SampleJson/src/JSON1.json"));
      JsonArray array1 = obj1.getAsJsonArray("array1");
      JsonObject obj2 = (JsonObject)Parser.parse(new 
   FileReader("/home/cloudera/Desktop/SampleJson/src/JSON2.json"));
      JsonArray array2 = obj1.getAsJsonArray("array2");
      JSONAssert.assertEquals(array1, array2, JSONCompareMode.STRICT);
   }
  }
  </code></pre>
  
  <p>The result what I am expecting is that key <code>Street</code> is missing in <code>JSON1</code> under <code>"id":"2"</code> or something similar that gives proper information that helps us to identify the missing key to perform <code>Junit</code> testing.</p>
  
  <p>The error which I got in IDE is </p>
  
  <pre><code>"java: cannot access org.json.JSONArray
    class file for org.json.JSONArray not found". 
  </code></pre>
  
  <p>Please help me in fixing this.</p>