private static @Nullable Container findFocusTraversalPolicyProvider(@Nullable Component component) {
    Container container = component == null || component instanceof Container ? (Container)component : component.getParent();
    while (container != null) {
      // ensure that container is focus cycle root and provides focus traversal policy
      // it means that Container.getFocusTraversalPolicy() returns non-null object
      if (container.isFocusCycleRoot() && container.isFocusTraversalPolicyProvider()) return container;
      container = container.getParent();
    }
    return null;
  }
private static @Nullable Container findFocusTraversalPolicyProvider(@Nullable Component component)