@Test
	public void testSelectionReturnsAfterFiltering() {
		//
		// Test that a selection made before a filter is still there after a filter
		//
		GTreeNode node = findNodeInTree("Leaf Child - Many B1");
		assertNotNull("Did not find existing child node in non filtered tree", node);

		gTree.setSelectedNode(node);
		waitForTree();

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

		setFilterText("No match text");
		node = findNodeInTree("Leaf Child - Many B1");
		assertNull("Found node that should have not passed filter", node);

		selectionPath = gTree.getSelectionPath();
		assertNull("Selection remained in tree after filter", selectionPath);

		clearFilterText();

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