public static @NotNull Map<Object, Object> getAllClientProperties(Object component) {
    Map<Object, Object> map = new LinkedHashMap<>();
    if (component instanceof RootPaneContainer) component = ((RootPaneContainer)component).getRootPane();
    if (component instanceof JComponent) {
      try {
        Method method = ReflectionUtil.getDeclaredMethod(JComponent.class, "getClientProperties");
        if (method == null) {
          return Collections.emptyMap();
        }
        method.setAccessible(true);
        Object table = method.invoke(component);
        method = ReflectionUtil.getDeclaredMethod(table.getClass(), "getKeys", Object[].class);
        if (method == null) return Collections.emptyMap();
        method.setAccessible(true);
        Object arr = method.invoke(table, new Object[1]);
        if (arr instanceof Object[]) {
          for (Object key : (Object[])arr) {
            map.put(key, ((JComponent)component).getClientProperty(key));
          }
        }
        return Collections.unmodifiableMap(map);
      }
      catch (Exception ignored) {
      }
    }
    return Collections.emptyMap();
  }
public static @NotNull Map<Object, Object> getAllClientProperties(Object component)