title: How to avoid double square brackets under JSON Array while retriving data from MAP
body: <p>I am storing data inside a LinkedHaspMap in form of String as key and JSONArray as its value 
  But while retrieving data from the Map , i am getting double square brackets for value</p>
  
  <p>This is my code </p>
  
  <pre><code>import java.util.Iterator;
  import java.util.LinkedHashMap;
  import java.util.Map;
  import com.google.gson.JsonArray;
  import com.google.gson.JsonObject;
  public class Test {
      public static void main(String args[]) {
          Map&lt;String, JsonArray&gt; datafromdb = new LinkedHashMap&lt;String, JsonArray&gt;();
          for(int i=0;i&lt;2;i++) {
              JsonArray jsonarray = new JsonArray();
              JsonObject pacs_obj = new JsonObject();
              pacs_obj.addProperty("pac_id", "1235");
              jsonarray.add(pacs_obj);
              String new_catid = "1";
  
              if (!datafromdb.containsKey(new_catid)) {
                  datafromdb.put(new_catid, new JsonArray());
              }
              datafromdb.get(new_catid).add(jsonarray);
          }
          Iterator it = datafromdb.entrySet().iterator();
          JsonArray catarr = new JsonArray();
          while (it.hasNext()) {
              Map.Entry pair = (Map.Entry) it.next();
              JsonArray array = (JsonArray) pair.getValue();
              System.out.println(array);
          }
      }
  }
  </code></pre>
  
  <p>And the output is </p>
  
  <pre><code>[[{"pac_id":"1235"}],[{"pac_id":"1235"}]]
  </code></pre>
  
  <p>Where as the output must be </p>
  
  <pre><code>[{"pac_id":"1235"},{"pac_id":"1235"}]
  </code></pre>
  
  <p>Could you please let me know how to resolve this issue </p>