@Test
	public void testUndoRemoval() throws Exception {

		editSampleEnum();

		EnumEditorPanel panel = findEditorPanel(tool.getToolFrame());
		JTable table = panel.getTable();
		EnumTableModel model = (EnumTableModel) table.getModel();

		assertFalse(model.hasChanges());

		undo(true); // will remove enum from DTM

		DataType dt = dtm.getDataType("/Category1/Colors");
		assertNull(dt);

		OptionDialog d = waitForDialogComponent(OptionDialog.class);
		assertNotNull(d);
		assertEquals("Close Enum Editor?", d.getTitle());

		JButton button = findButtonByText(d.getComponent(), "Continue Edit");
		assertNotNull(button);
		runSwing(() -> button.getActionListeners()[0].actionPerformed(null));
		waitForSwing();

		assertTrue(panel.needsSave());

		DockingActionIf applyAction = getApplyAction();
		assertTrue(applyAction.isEnabled());

		applyChanges(true);

		dt = dtm.getDataType("/Category1/Colors");
		assertNotNull(dt);
	}
{@link AbstractEnumEditorUndoRedoTest} contains tests which should be applied to the various 
{@link DataTypeManager} implementations which are responsible for setting {@code dtm} during
the setUp phase.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/editor/AbstractEnumEditorUndoRedoTest.java