@Test
	public void testCloseCategoryIfOrgnodesGetOutOfBalance() throws Exception {

		// The default value is 200.  Use a smaller value for testing for speed.
		runSwing(() -> plugin.setNodeGroupThreshold(20));

		showSymbolTree();
		GTreeNode functionsNode = rootNode.getChild("Functions");
		assertFalse(functionsNode.isLoaded());
		functionsNode.expand();
		waitForTree(tree);
		assertTrue(functionsNode.isLoaded());

		// add lots of nodes to cause functionsNode to close
		int reorganizeLimit = ((SymbolTreeRootNode) rootNode).getReorganizeLimit();
		addFunctions(reorganizeLimit);
		waitForTree(tree);

		assertFalse(functionsNode.isLoaded());

		functionsNode.expand();
		waitForTree(tree);

		// should have 4 nodes, one for each of the original 3 functions and a org node with
		// all new "FUNCTION*" named functions
		assertEquals(4, functionsNode.getChildCount());
	}
Tests for the symbol tree plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/symboltree/SymbolTreePlugin1Test.java