public JSONObject dumpHierarchy(View view) throws JSONException {
    Point offset = new Point(-getViewLeft(view), -getViewTop(view));
    return dumpHierarchy(view, offset);
  }
Dumps information about a layout hierarchy into a JSON object
core/src/main/java/com/facebook/testing/screenshot/layouthierarchy/LayoutHierarchyDumper.java