code: public static AccessibilityNodeInfoCompat searchFromBfs(
              Context context, AccessibilityNodeInfoCompat node, NodeFilter filter) {
          if (node == null) {
              return null;
          }
  
          final LinkedList<AccessibilityNodeInfoCompat> queue =
                  new LinkedList<AccessibilityNodeInfoCompat>();
  
          queue.add(AccessibilityNodeInfoCompat.obtain(node));
  
          while (!queue.isEmpty()) {
              final AccessibilityNodeInfoCompat item = queue.removeFirst();
  
              if (filter.accept(context, item)) {
                  return AccessibilityNodeInfoCompat.obtain(item);
              }
  
              final int childCount = item.getChildCount();
  
              for (int i = 0; i < childCount; i++) {
                  final AccessibilityNodeInfoCompat child = item.getChild(i);
  
                  if (child != null) {
                      queue.addLast(child);
                  }
              }
          }
  
          return null;
      }
docs: Returns the result of applying a filter using breadth-first traversal.
  
  @param context The parent context.
  @param node The root node to traverse from.
  @param filter The filter to satisfy.
  @return The first node reached via BFS traversal that satisfies the
  filter.