title: Gson Array of Array Deserialization
body: <p>I've the following JSON structure:</p>
  
  <pre><code>[
   {
    "id": 1,
    "subcategories": [
     {
      "id": 2,
      "subcategories": [
      ]
     },
     {
      "id": 3,
      "subcategories": [
      ]
     }
    ]
   },
   {
    "id": 4,
    "subcategories": [
     {
      "id": 5,
      subcategories: [
      ]
     }
    ]
   }
  ]
  </code></pre>
  
  <p>The model class for a Category (some fields like title are omitted for simplicity),
  for reflecting JSON structure:</p>
  
  <pre><code>public class Category {
      int id = 0;
      ArrayList&lt;Category&gt; subCategories = null;
  }
  </code></pre>
  
  <p>I'm trying to parse that with Gson library (2.2.4), having hard times deserializing inner array to arraylist:</p>
  
  <pre><code>Gson gson = new Gson();
  Type collectionType = new TypeToken&lt;ArrayList&lt;Category&gt;&gt;(){}.getType();
  ArrayList categories = gson.fromJson(json, collectionType);
  </code></pre>
  
  <p>Category.subCategories is always null.</p>