private void addGroup(ProgramNode destNode, ProgramNode dropNode, int targetIndex,
			int dropAction)
			throws NotFoundException, CircularDependencyException, DuplicateGroupException {
		Group group = null;
		ProgramNode targetParent = (ProgramNode) destNode.getParent();

		// first add drop fragment or module
		//  to target's parent
		ProgramModule targetParentModule =
			(targetParent != null) ? targetParent.getModule() : destNode.getModule();

		ProgramFragment dropFragment = dropNode.getFragment();
		ProgramModule dropModule = dropNode.getModule();

		if (dropAction == DnDConstants.ACTION_COPY) {
			if (dropFragment != null) {
				targetParentModule.add(dropFragment);
				group = dropFragment;
			}
			else {
				targetParentModule.add(dropModule);
				group = dropModule;
			}
		}
		else {
			targetParentModule.reparent(dropNode.getName(), dropNode.getParentModule());
			if (dropFragment != null) {
				group = dropFragment;
			}
			else {
				group = dropModule;
			}
		}
		tree.groupAdded(group);
		targetParentModule.moveChild(group.getName(), targetIndex);
		tree.reorder(dropNode.getGroup(), targetParentModule, targetIndex);
	}
Add a new group to the destNode or re-parent the drop Node to
the destNode's parent (or to root if destNode's parent is null).
@param destNode drop site for dropped node
@param dropNode node to drop at destNode
@param targetIndex new index for node that is added
@param dropAction DnDConstants.ACTION_COPY or ACTION_MOVE
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ReorderManager.java