public JPopupMenu getPopupMenu() {
		if (popupMenu == null) {
			popupMenu = new JPopupMenu(name);

			List<ManagedMenuItem> list = new ArrayList<>(managedMenuItems);
			Collections.sort(list, comparator);
			String lastGroup = NULL_GROUP_NAME;
			boolean hasMenuItems = false;

			for (ManagedMenuItem item : list) {
				String itemGroup = item.getGroup();
				if (itemGroup == null) {
					itemGroup = NULL_GROUP_NAME;
				}

				if (!lastGroup.equals(itemGroup) && hasMenuItems) {
					popupMenu.addSeparator();
				}

				lastGroup = item.getGroup();
				if (lastGroup == null) {
					lastGroup = NULL_GROUP_NAME;
				}

				popupMenu.add(item.getMenuItem());
				hasMenuItems = true;
			}
		}
		return popupMenu;
	}
Returns a JPopupMenu for the action hierarchy
@return the popup menu
Ghidra/Framework/Docking/src/main/java/docking/menu/MenuManager.java