@Test
	public void testProgrammaticSelectAndFilter() {
		//
		// Open a node and select it.  Make sure it is again selected if it passes the 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("Many B1");
		node = findNodeInTree("Leaf Child - Many B1");
		assertNotNull("Did not find existing child node in filtered tree", node);

		selectionPath = gTree.getSelectionPath();
		assertNotNull("Node matching filter should still be selected after filter", selectionPath);
		assertEquals(node, selectionPath.getLastPathComponent());

		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