static @Nullable Boolean isSelected(@NotNull JComponent component) {
    Object value = component.getClientProperty(SELECTED_KEY);
    if (value instanceof Boolean isSelected) return isSelected;
    return null;
  }
static @Nullable Boolean isSelected(@NotNull JComponent component)