@Test
	public void testCreateEnumFromSelection_DuplicateName() throws Exception {

		// This test tests enum name collisions are handled correctly

		createTwoUniqueEnums();

		// create an enum that we will use to trigger a name conflict
		String existingEnumName = "myNewEnum";
		tx(() -> {
			Enum e = new EnumDataType(existingEnumName, 1);
			e.add("Purple", 0x30);
			e.add("White", 0x40);
			e.add("Yellow", 0x50);

			programNode.getCategory().addDataType(e, null);
		});

		selectAndMergeTwoEnums("Colors", "MoreColors");

		Window window = waitForWindow("Enter Enum Name");
		JTextField tf = findComponent(window, JTextField.class);
		setText(tf, existingEnumName);
		pressButtonByText(window, "OK");

		//
		// We used an existing name; handle the new dialog
		//
		Window window2 = waitForWindow("Duplicate Enum Name");
		JTextField tf2 = findComponent(window2, JTextField.class);

		String validName = "myNewEnum2";
		setText(tf2, validName);
		pressButtonByText(window2, "OK");
		assertFalse(window2.isShowing());

		assertNotNull(getEnum(validName));
	}
Tests for the 'make enum from a selection' action
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/CreateEnumFromSelectionTest.java