public static @Nullable JBPopup getPopupFor(@Nullable Window wnd) {
    if (wnd instanceof JWindow) {
      JRootPane root = ((JWindow)wnd).getRootPane();
      return (JBPopup)root.getClientProperty(JBPopup.KEY);
    }
    return null;
  }
public static @Nullable JBPopup getPopupFor(@Nullable Window wnd)