code: private static void parseChildShapes(ArrayList<Shape> shapes,
                                           JSONObject modelJSON,
                                           Shape current) throws JSONException {
          if (modelJSON.has("childShapes")) {
              ArrayList<Shape> childShapes = new ArrayList<Shape>();
  
              JSONArray childShapeObject = modelJSON.getJSONArray("childShapes");
              for (int i = 0; i < childShapeObject.length(); i++) {
                  childShapes.add(getShapeWithId(childShapeObject.getJSONObject(i).getString("resourceId"),
                                                 shapes));
              }
              if (childShapes.size() > 0) {
                  for (Shape each : childShapes) {
                      each.setParent(current);
                  }
                  current.setChildShapes(childShapes);
              }
              ;
          }
      }
docs: creates a shape list containing all child shapes and set it to the
  current shape new shape get added to the shape array
  @param shapes
  @param modelJSON
  @param current
  @throws org.json.JSONException