code: public static AccessibilityNodeInfoCompat getRoot(AccessibilityNodeInfoCompat node) {
          if (node == null) {
              return null;
          }
  
          AccessibilityNodeInfoCompat current = null;
          AccessibilityNodeInfoCompat parent = AccessibilityNodeInfoCompat.obtain(node);
  
          do {
              current = parent;
              parent = current.getParent();
          } while (parent != null);
  
          return current;
      }
docs: Returns the root node of the tree containing {@code node}.