public static @NotNull Dimension getPopupSize(@NotNull JBPopup popup) {
    Dimension size = null;
    if (popup instanceof AbstractPopup) {
      final String dimensionKey = ((AbstractPopup)popup).getDimensionServiceKey();
      if (dimensionKey != null) {
        size = DimensionService.getInstance().getSize(dimensionKey);
      }
    }

    if (size == null) {
      size = popup.getContent().getPreferredSize();
    }

    return size;
  }
public static @NotNull Dimension getPopupSize(@NotNull JBPopup popup)