@Test
	public void testCutFolderToFragment() throws Exception {
		// select a folder that has fragments and subfolders that have
		// fragments, and cut.
		// select a fragment not in the hierarchy of the cut folder
		// and paste.
		// verify that the destination fragment contains all code units
		// from the cut folder's descendants;
		// verify that the cut folder and all of its descendants are
		// removed from the program.

		AddressSet set = new AddressSet();

		// first create a folder and add fragments and folders to it
		tx(program, () -> {
			ProgramModule m = root.getModule().createModule("Test");
			m.add(listing.getFragment("Main Tree", ".text"));
			m.add(listing.getFragment("Main Tree", ".debug_data"));
			m.add(listing.getModule("Main Tree", "Subroutines"));
			m.add(listing.getModule("Main Tree", "Functions"));
			set.add(m.getAddressSet());
		});

		expandNode(root);

		ProgramNode testNode = root.getChild("Test");
		setSelectionPath(testNode);

		performTreeAction(cutAction);

		// paste at 010074d4
		ProgramNode stringsNode = root.getChild("Strings");
		visitNode(stringsNode);
		ProgramNode cNode = stringsNode.getChild("L");
		visitNode(cNode);
		ProgramNode fnode = cNode.getChild("testl");
		setSelectionPath(fnode);

		performTreeAction(pasteAction);
		waitForProgram(program);

		root = (ProgramNode) tree.getModel().getRoot();
		expandNode(root);
		stringsNode = root.getChild("Strings");
		visitNode(stringsNode);
		cNode = stringsNode.getChild("L");
		visitNode(cNode);
		fnode = cNode.getChild("testl");

		assertTrue(fnode.getFragment().contains(set));
		assertNull(listing.getModule("Main Tree", "Test"));
		assertNull(listing.getModule("Main Tree", "Subroutines"));
		assertNull(listing.getModule("Main Tree", "Functions"));
		assertNull(listing.getFragment("Main Tree", ".text"));
		assertNull(listing.getFragment("Main Tree", ".debug_data"));
		assertEquals(0, findNodes("Test").length);
		assertEquals(0, findNodes("Subroutines").length);
		assertEquals(0, findNodes("Functions").length);
		assertEquals(0, findNodes(".text").length);
		assertEquals(0, findNodes(".debug_data").length);

		undo();
		stringsNode = root.getChild("Strings");
		visitNode(stringsNode);
		cNode = stringsNode.getChild("L");
		visitNode(cNode);
		fnode = cNode.getChild("testl");

		assertFalse(fnode.getFragment().contains(set));
		expandNode(root);
		testNode = root.getChild("Test");
		assertNotNull(testNode);
		assertNotNull(testNode.getChild("Subroutines"));
		assertNotNull(testNode.getChild("Functions"));
		assertNotNull(testNode.getChild(".text"));
		assertNotNull(testNode.getChild(".debug_data"));

		redo();
		stringsNode = root.getChild("Strings");
		visitNode(stringsNode);
		cNode = stringsNode.getChild("L");
		visitNode(cNode);
		fnode = cNode.getChild("testl");
		assertTrue(fnode.getFragment().contains(set));
		assertNull(listing.getModule("Main Tree", "Test"));
		assertNull(listing.getModule("Main Tree", "Subroutines"));
		assertNull(listing.getModule("Main Tree", "Functions"));
		assertNull(listing.getFragment("Main Tree", ".text"));
		assertNull(listing.getFragment("Main Tree", ".debug_data"));
		assertEquals(0, findNodes("Test").length);
		assertEquals(0, findNodes("Subroutines").length);
		assertEquals(0, findNodes("Functions").length);
		assertEquals(0, findNodes(".text").length);
		assertEquals(0, findNodes(".debug_data").length);
	}
Tests for cut/copy/paste in the Program tree.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/programtree/ProgramTreePlugin2Test.java