public static boolean isMinimized(@Nullable Window window) {
    if (!(window instanceof Frame frame)) {
      return false;
    }

    return frame.getExtendedState() == Frame.ICONIFIED;
  }
public static boolean isMinimized(@Nullable Window window)