code: public static AccessibilityNodeInfoCompat focusSearch(
              AccessibilityNodeInfoCompat node, int direction) {
          final AccessibilityNodeInfoRef ref = AccessibilityNodeInfoRef.unOwned(node);
  
          switch (direction) {
              case SEARCH_FORWARD: {
                  if (!ref.nextInOrder()) {
                      return null;
                  }
                  return ref.release();
              }
              case SEARCH_BACKWARD: {
                  if (!ref.previousInOrder()) {
                      return null;
                  }
                  return ref.release();
              }
          }
  
          return null;
      }
docs: Perform in-order navigation from a given node in a particular direction.
  
  @param node The starting node.
  @param direction The direction to travel.
  @return The next node in the specified direction, or {@code null} if
  there are no more nodes.