@Test
	public void testCollapseAllDtms() {
		env.showTool();

		List<GTreeNode> children = archiveRootNode.getChildren();
		for (GTreeNode node : children) {
			expandNode(node);
		}

		DockingActionIf collapseAllAction = getAction(plugin, "Collapse All");
		assertNotNull(collapseAllAction);
		assertTrue(collapseAllAction.isEnabled());
		runSwing(() -> {
			ActionContext context = new DataTypesActionContext(null, null, tree, null, true);
			collapseAllAction.actionPerformed(context);
		}, true);
		waitForTree();

		for (GTreeNode node : children) {
			assertFalse(tree.isExpanded(node.getTreePath()));
		}
	}
Test the favorites and data manager services.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/FavoritesAndMiscTest.java