@Test
	public void testRefilter() {
		final GTreeFilterProvider provider = new DefaultGTreeFilterProvider(gTree) {
			@Override
			public GTreeFilter getFilter() {
				if (filterEnabled) {
					return super.getFilter();
				}
				return new DisabledGTreeFilter();
			}
		};
		// Set the filter provider 
		runSwing(() -> gTree.setFilterProvider(provider));

		setFilterOptions(TextFilterStrategy.CONTAINS, false);
		//
		// Some basic filter tests
		//
		GTreeNode node = findNodeInTree("Leaf Child - Many B1");
		assertNotNull("Did not find existing child node in non filtered tree", node);

		GTreeNode node2 = findNodeInTree("Leaf Child - Single B1");
		assertNotNull("Did not find existing child node in non filtered tree", node2);

		setFilterText("Many B1");
		node = findNodeInTree("Leaf Child - Many B1");
		assertNotNull("Did not find existing child node in filtered tree", node);

		node2 = findNodeInTree("Leaf Child - Single B1");
		assertNull("Found a node in the tree that should have been filtered out", node2);

		clearFilterText();

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

		setFilterText("Zoolander");
		node = findNodeInTree("Leaf Child - Many B1");
		assertNull("Found a node in the tree that should have been filtered out", node);

		//
		// Now try filtering and re-filtering
		//
		setFilterText("Many B1");
		node = findNodeInTree("Leaf Child - Many B1");
		assertNotNull("Did not find existing child node in filtered tree", node);

		node2 = findNodeInTree("Leaf Child - Single B1");
		assertNull("Found a node in the tree that should have been filtered out", node2);

		gTree.refilterNow();
		waitForTree();
		node = findNodeInTree("Leaf Child - Many B1");
		assertNotNull("Did not find existing child node in filtered tree", node);

		node2 = findNodeInTree("Leaf Child - Single B1");
		assertNull("Found a node in the tree that should have been filtered out", node2);

		filterEnabled = false;
		gTree.refilterNow();
		waitForTree();
		node = findNodeInTree("Leaf Child - Many B1");
		assertNull("Found node when filter should not have matched after a refilter", node);

		node2 = findNodeInTree("Leaf Child - Single B1");
		assertNull("Found a node in the tree that should have been filtered out", node2);
	}
Test variable to easily control the filtering of test filters.
Ghidra/Framework/Docking/src/test.slow/java/docking/widgets/tree/GTreeTest.java