@Test
	public void testSelectionDuringFilterReturnsAfterFilter() {
		//
		// Test that a selection made during a filter returns after the filter is removed.
		//
		setFilterText("Many B1");
		GTreeNode node = findNodeInTree("Leaf Child - Many B1");
		assertNotNull("Did not find existing child node in filtered tree", node);

		gTree.setSelectedNode(node);
		waitForTree();
		TreePath selectionPath = gTree.getSelectionPath();
		assertNotNull("Tree did not select node", selectionPath);
		assertEquals(node, selectionPath.getLastPathComponent());

		clearFilterText();

		selectionPath = gTree.getSelectionPath();
		assertNotNull("Tree did not select node", selectionPath);
		assertEquals(node, selectionPath.getLastPathComponent());

		//
		// Same test, but with a selection that existed before the filter's selection change
		//
		node = findNodeInTree("Leaf Child - Many B1");
		gTree.clearSelectionPaths();
		waitForTree();

		gTree.setSelectedNode(node);
		waitForTree();

		selectionPath = gTree.getSelectionPath();
		assertNotNull("Tree did not select node", selectionPath);
		assertEquals(node, selectionPath.getLastPathComponent());

		setFilterText("ChildrenNodeA");// filter to show the node below

		GTreeNode anotherNode =
			findNodeInTree(NonLeafWithOneLevelOfChildrenNodeA.class.getSimpleName());
		assertNotNull("Could not find expected node", anotherNode);

		gTree.setSelectedNode(anotherNode);
		waitForTree();

		selectionPath = gTree.getSelectionPath();
		assertNotNull("Tree did not select node", selectionPath);
		assertEquals(anotherNode, selectionPath.getLastPathComponent());

		clearFilterText();

		selectionPath = gTree.getSelectionPath();
		assertNotNull("Tree did not select node", selectionPath);
		assertEquals(anotherNode, selectionPath.getLastPathComponent());
	}
Test variable to easily control the filtering of test filters.
Ghidra/Framework/Docking/src/test.slow/java/docking/widgets/tree/GTreeTest.java