code: private static boolean hasMatchingAncestor(
              Context context, AccessibilityNodeInfoCompat node, NodeFilter filter) {
          if (node == null) {
              return false;
          }
  
          final AccessibilityNodeInfoCompat result = getMatchingAncestor(context, node, filter);
          if (result == null) {
              return false;
          }
  
          result.recycle();
          return true;
      }
docs: Check whether a given node has a scrollable ancestor.
  
  @param node The node to examine.
  @return {@code true} if one of the node's ancestors is scrollable.