docs: public static boolean insertSeparatorIfNeeded(JPopupMenu popupMenu, int position) {
          final int menuComponentCount = popupMenu.getComponentCount();
          if (menuComponentCount == 0 || position <= 0 || position > menuComponentCount) {
              return false;
          }
          final Component currentComponent = popupMenu.getComponent(position);
          if (isPopupMenuSeparator(currentComponent)) {
              return false;
          }
          final Component previousComponent = popupMenu.getComponent(position - 1);
          if (isPopupMenuSeparator(previousComponent)) {
              return false;
          }
          popupMenu.insert(new JPopupMenu.Separator(), position);
          return true;
      }