private void addToModule(ProgramNode destNode, ProgramNode dropNode,
							 int dropAction)
		throws DuplicateGroupException, NotFoundException, CircularDependencyException {
		// destination is a Module
		ProgramModule destModule = destNode.getModule();
		ProgramModule parentModule = dropNode.getParentModule();
		if (!destNode.wasVisited()) {
		    tree.visitNode(destNode);
		}
		if (dropNode.isFragment()) {
		    ProgramFragment fragment = dropNode.getFragment();
		    if (dropAction == DnDConstants.ACTION_COPY) {
		        destModule.add(fragment);
		    }
		    else {
		        destModule.reparent(fragment.getName(), parentModule);
		    }
		}
		else {
		    ProgramModule module = dropNode.getModule();
		    if (dropAction == DnDConstants.ACTION_COPY) {
		        destModule.add(module);
		    }
		    else {
		        destModule.reparent(module.getName(), parentModule);
		    }
		    if (tree.isExpanded(destNode.getTreePath())) {
		        tree.groupAdded(module); // need to add the
		                // group now so that the expansion can be
		                // matched
		    }
		}
		// don't match the expansion state unless the destination
		// node is already expanded
		if (tree.isExpanded(destNode.getTreePath())) {
		    // apply expansion state of the dropped node to the new node.
		    ProgramNode newnode = tree.getChild(destNode, dropNode.getName());
		    if (newnode != null) {
		        tree.matchExpansionState(dropNode, newnode);
		    }
		}
	}
Check whether the drop is ok given that destNode is a fragment.
@param destNode fragment node
@param dropNode node that is getting dropped
@param dropAction move or copy action
@return true if the destNode is a valid drop target
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/DnDMoveManager.java