public JSONObject dumpHierarchy(Object obj, Point offset) throws JSONException {
    JSONObject node = dumpAttributes(obj, offset);
    for (HierarchyPlugin plugin : mHierarchyPlugins) {
      if (plugin.accept(obj)) {
        // First hierarchy wins
        plugin.putHierarchy(this, node, obj, offset);
        return node;
      }
    }
    throw new IllegalStateException(
        "No available plugins for type " + obj.getClass().getCanonicalName());
  }
Dumps information about a layout hierarchy into a JSON object
core/src/main/java/com/facebook/testing/screenshot/layouthierarchy/LayoutHierarchyDumper.java