public JMenu getMenu() {
		if (menu == null) {
			menu = new JMenu(name);
			if (mnemonicKey != '\0') {
				menu.setMnemonic(mnemonicKey);
			}
			if (menuHandler != null) {
				menu.addMenuListener(menuHandler);
			}

			List<ManagedMenuItem> list = new ArrayList<>(managedMenuItems);
			Collections.sort(list, comparator);
			String lastGroup = null;

			for (ManagedMenuItem item : list) {
				if (lastGroup != null && !lastGroup.equals(item.getGroup())) {
					menu.addSeparator();
				}
				lastGroup = item.getGroup();
				menu.add(item.getMenuItem());
			}
		}
		return menu;
	}
Returns a Menu hierarchy of all the actions
@return the menu
Ghidra/Framework/Docking/src/main/java/docking/menu/MenuManager.java