@Test
	public void testRestoreTreeState_ExpandedStateOnly() {
		//
		// Test that we can setup the tree, record its expanded state, change the tree 
		// and then restore the saved state
		//

		GTreeNode originalNode = findNodeInTree("Leaf Child - Many B1").getParent();
		assertNotNull("Did not find existing child node in non filtered tree", originalNode);

		gTree.expandPath(originalNode);
		waitForTree();

		List<TreePath> expandedPaths = gTree.getExpandedPaths();
		assertEquals(3, expandedPaths.size());

		// make sure one of the expanded paths contains the originalNode
		assertExpanded(originalNode);

		GTreeState savedState = gTree.getTreeState();

		// now collapse the tree and restore the state
		gTree.collapseAll(gTree.getViewRoot());
		waitForTree();

		expandedPaths = gTree.getExpandedPaths();
		assertTrue(expandedPaths.isEmpty());

		gTree.restoreTreeState(savedState);
		waitForTree();

		expandedPaths = gTree.getExpandedPaths();
		assertEquals(3, expandedPaths.size());
		assertExpanded(originalNode);
	}
Test variable to easily control the filtering of test filters.
Ghidra/Framework/Docking/src/test.slow/java/docking/widgets/tree/GTreeTest.java