@Test
	public void testGetChosenDataType() throws Exception {
		env.showTool();
		expandNode(programNode);
		CategoryNode cat1Node = (CategoryNode) programNode.getChild("Category1");
		expandNode(cat1Node);
		CategoryNode cat2Node = (CategoryNode) cat1Node.getChild("Category2");
		expandNode(cat2Node);
		CategoryNode cat3Node = (CategoryNode) cat2Node.getChild("Category3");
		expandNode(cat3Node);

		Structure struct = new StructureDataType("ArrayStruct", 0);
		struct.add(new ByteDataType());
		struct.add(new WordDataType());

		int transactionID = program.startTransaction("test");
		Category c = cat3Node.getCategory();
		c.addDataType(struct, null);
		program.endTransaction(transactionID, true);

		program.flushEvents();
		waitForSwing();

		runSwing(() -> plugin.promptForDataType("ArrayStruct"), false);

		DataTypeChooserDialog d = waitForDialogComponent(DataTypeChooserDialog.class);

		assertNotNull(d);

		GTree gtree = (GTree) getInstanceField("tree", d);
		waitForTree(gtree);

		ArchiveRootNode root = (ArchiveRootNode) gtree.getModelRoot();
		ArchiveNode programNode1 = (ArchiveNode) root.getChild(PROGRAM_NAME);

		assertNotNull("could not find " + PROGRAM_NAME + " in " + root, programNode1);
		expandNode(programNode1);
		cat1Node = (CategoryNode) programNode1.getChild("Category1");
		expandNode(cat1Node);
		cat2Node = (CategoryNode) cat1Node.getChild("Category2");
		expandNode(cat2Node);
		cat3Node = (CategoryNode) cat2Node.getChild("Category3");
		expandNode(cat3Node);

		DataTypeNode structNode = (DataTypeNode) cat3Node.getChild("ArrayStruct");
		DataType s = structNode.getDataType();

		gtree.setSelectedNode(structNode);
		waitForTree(gtree);

		JButton okButton = (JButton) getInstanceField("okButton", d);
		assertTrue(okButton.isEnabled());
		runSwing(() -> okButton.doClick());

		DataType selectedDataType = d.getSelectedDataType();
		assertEquals(selectedDataType, s);
	}
Test the favorites and data manager services.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/FavoritesAndMiscTest.java