@Test
	public void testCancelFilter() {
		//
		// Setup a long running filter and make sure that the progress bar is show.  Then, cancel
		// that filter and make sure that the filter is cleared and the progress bar is hidden.
		//

		final ReallySlowGTreeFilter filter = new ReallySlowGTreeFilter();
		final GTreeFilterProvider provider = new DefaultGTreeFilterProvider(gTree) {
			@Override
			public GTreeFilter getFilter() {
				GTreeFilter superFilter = super.getFilter();
				if (superFilter == null) {
					return null;
				}
				return filter;
			}
		};
		provider.setFilterText("Hey");
		// Set the filter  (Note: don't use setTextFilterFactory(), as it waits for the tree, 
		// which is not what this test wants to do)
		runSwing(() -> gTree.setFilterProvider(provider));

		// Wait for the tree to be 'busy'
		waitForTreeToStartWork();

		// Verify the progress monitor is showing
		assertProgressPanel(true);

		// Press the cancel button on the progress monitor
		pressProgressPanelCancelButton();

		waitForTree();

		// Verify no filter
		String filterText = gTree.getFilterText();
		assertEquals("", filterText);

		// Verify no progress component
		assertProgressPanel(false);
	}
Test variable to easily control the filtering of test filters.
Ghidra/Framework/Docking/src/test.slow/java/docking/widgets/tree/GTreeTest.java