@Contract("null -> null")
  private static @Nullable JComponent getPropertiesHolder(@Nullable Component component) {
    if (component instanceof JComponent) return (JComponent)component;
    if (component instanceof Window && component instanceof RootPaneContainer container) {
      // store window properties in its root pane
      return container.getRootPane();
    }
    return null;
  }
@Contract("null -> null")
  private static @Nullable JComponent getPropertiesHolder(@Nullable Component component)