void reorder(Group group, ProgramModule parentModule, int index) {

		synchronized (root) {
			ArrayList<TreePath> list = new ArrayList<>();
			ProgramNode[] nodes = findNodes(group);
			Group[] groups = parentModule.getChildren();

			for (ProgramNode node : nodes) {

				ProgramNode parent = (ProgramNode) node.getParent();
				if (!parent.getModule().equals(parentModule)) {
					continue;
				}
				TreePath path = parent.getTreePath();
				if (isExpanded(path)) {
					list.add(path);
				}

				Enumeration<TreePath> it = getExpandedDescendants(path);
				if (it != null) {
					while (it.hasMoreElements()) {
						list.add(it.nextElement());
					}
				}
				ProgramNode child = (ProgramNode) parent.getChildAt(index);
				if (child.getName().equals(groups[index].getName())) {
					continue;
				}

				int tempIndex = index;
				if (index == parent.getChildCount()) {
					tempIndex = index - 1;
				}

				parent.insert(node, tempIndex);
				model.reload(parent);

			}
			for (TreePath p : list) {
				expandPath(p);
			}
		}
	}
Reorder the children of  parentModule so that the given
group becomes child at the specified index.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramDnDTree.java