@Test
	public void testRestoreTreeState_NoSelectedNodes_BeforeOrAfterFilter() {

		//
		// Tests the base use case for the tree's 'restore state', which is to put the tree
		// back to the expanded state before a filter *if the user does NOT click the tree*.
		//

		installLargeTreeModel_WithManyExpandablePaths();

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

		gTree.expandPath(originalNode);
		waitForTree();

		TreePath expected = getLastVisiblePath();

		// Set a filter that opens more paths than we had initially expanded.  This ensures
		// that the tree's state changes after the filter is applied.
		setFilterText("Leaf");

		clearFilterText();

		TreePath selectionPath = gTree.getSelectionPath();
		assertNull("No node should be selected", selectionPath);

		List<TreePath> expandedPaths = gTree.getExpandedPaths();
		assertExpaned(expandedPaths, originalNode);

		TreePath newFirstVisiblePath = getLastVisiblePath();
		assertCloseEnough(expected, newFirstVisiblePath);
	}
Test variable to easily control the filtering of test filters.
Ghidra/Framework/Docking/src/test.slow/java/docking/widgets/tree/GTreeTest.java