public void record(RecordBuilderImpl recordBuilder) {
    storeBitmap(recordBuilder);
    try {
      JSONObject dump = new JSONObject();
      JSONObject viewDump = LayoutHierarchyDumper.create().dumpHierarchy(recordBuilder.getView());
      dump.put("viewHierarchy", viewDump);
      dump.put("version", METADATA_VERSION);

      AccessibilityUtil.AXTreeNode axTree =
          recordBuilder.getIncludeAccessibilityInfo()
              ? AccessibilityUtil.generateAccessibilityTree(recordBuilder.getView(), null)
              : null;
      dump.put("axHierarchy", AccessibilityHierarchyDumper.dumpHierarchy(axTree));
      mAlbum.writeViewHierarchyFile(recordBuilder.getName(), dump.toString(2));

      if (axTree != null) {
        JSONObject issues = new JSONObject();
        issues.put("axIssues", AccessibilityIssuesDumper.dumpIssues(axTree));
        mAlbum.writeAxIssuesFile(recordBuilder.getName(), issues.toString(2));
      }

      mAlbum.addRecord(recordBuilder);
    } catch (IOException | JSONException e) {
      throw new RuntimeException(e);
    }
  }
Records the RecordBuilderImpl, and verifies if required
core/src/main/java/com/facebook/testing/screenshot/internal/ScreenshotImpl.java