code: public static AccessibilityNodeInfoCompat getSelfOrMatchingAncestor(
              Context context, AccessibilityNodeInfoCompat node, NodeFilter filter) {
          if (node == null) {
              return null;
          }
  
          if (filter.accept(context, node)) {
              return AccessibilityNodeInfoCompat.obtain(node);
          }
  
          return getMatchingAncestor(context, node, filter);
      }
docs: Returns the {@code node} if it matches the {@code filter}, or the first
  matching ancestor. Returns {@code null} if no nodes match.