@Test
	public void testListeners() throws Exception {
		MyChangeListener changeListener = new MyChangeListener();
		plugin.addDataTypeManagerChangeListener(changeListener);

		tree.expandPath(builtInNode);
		waitForTree();
		DataTypeNode node = (DataTypeNode) builtInNode.getChild("PascalUnicode");

		tree.setSelectedNode(node);
		waitForTree();

		performToggleAction(favoritesAction, true);
		waitForSwing();

		List<DataType> dts = changeListener.getFavoriteDts();
		boolean found = false;
		for (DataType dt : dts) {
			if (dt.getName().equals("PascalUnicode")) {
				found = true;
				break;
			}
		}
		if (!found) {
			Assert.fail("Did not find MBCString as a favorite!");
		}

		// turn off favorite
		tree.setSelectedNode(node);

		performToggleAction(favoritesAction, false);
		waitForSwing();

		dts = changeListener.getFavoriteDts();
		for (DataType dt : dts) {
			if (dt.getName().equals("MBCString")) {
				Assert.fail("Should not have found MBCString as a favorite!");
			}
		}
	}
Test the favorites and data manager services.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/FavoritesAndMiscTest.java