title: Java: Parsing nested array in Jackson
body: <p>I am trying to parse the following json into Java objects. It has an outer object called <code>BaseCategory</code>.  <code>BaseCategory</code> has a Set of Category objects.  A Category has a set of SubCategory Objects.  </p>
  
  <pre><code>{
     "name":"base",
     "categories":[
          {
              "name":"category1",
              "subCategories": [
                     {
                         "name":"subCategory1"
                     },
                     {
                          "name": "subCategory2"
                     }
               ]
          },
          {
                "name":"category2",
                "subCategories": [
                      {
                            "name":"subCategory3"
                      },
                      {
                            "name": "subCategory4"
                      }
                ]
  
          }
     ]
  }
  </code></pre>
  
  <p>The <code>POJO</code> classes are below.  Stripped down to show just the relevant info.  Could you please provide some help to parse this.  </p>
  
  <pre><code>public class BaseCategory {
      private String name;
      private Set&lt;Category&gt; categories = new HashSet&lt;Category&gt;();
      //setters and getters
  }
  
  public class Category {
      private String name;
      private Set&lt;SubCategory&gt; subCategories = new HashSet&lt;SubCategory&gt;();
      //setters and getters
  }
  
  public class SubCategory {
       private String name;
       //setters and getters
  }
  </code></pre>