@Override
  public Component getFocusedDescendantFor(@NotNull Component component) {
    final Component focused = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    if (focused == null) return null;

    if (focused == component || SwingUtilities.isDescendingFrom(focused, component)) return focused;

    return null;
  }
@Override
  public Component getFocusedDescendantFor(@NotNull Component component)