void move(FragmentDB destFrag, Address min, Address max) throws NotFoundException {

		lock.acquire();
		try {
			if (!getProgram().getMemory().contains(min, max)) {
				throw new NotFoundException(
					"Address range for " + min + ", " + max + " is not contained in memory");
			}
			AddressSet set = new AddressSet();

			AddressRangeIterator iter = fragMap.getAddressRanges(min, max);
			AddressSet addrSet = new AddressSet(min, max);

			while (iter.hasNext() && !addrSet.isEmpty()) {
				AddressRange range = iter.next();
				Field field = fragMap.getValue(range.getMinAddress());
				try {
					FragmentDB frag = getFragmentDB(field.getLongValue());
					if (frag != destFrag) {
						AddressSet intersection = addrSet.intersect(frag);
						AddressRangeIterator fragRangeIter = intersection.getAddressRanges();
						while (fragRangeIter.hasNext()) {
							AddressRange fragRange = fragRangeIter.next();
							set.add(fragRange);
							frag.removeRange(fragRange);
						}
						addrSet = addrSet.subtract(intersection);
					}
				}
				catch (IOException e) {
					errHandler.dbError(e);
					return;
				}
			}

			Field field = new LongField(destFrag.getKey());

			AddressRangeIterator rangeIter = set.getAddressRanges();
			while (rangeIter.hasNext()) {
				AddressRange range = rangeIter.next();
				fragMap.paintRange(range.getMinAddress(), range.getMaxAddress(), field);
				destFrag.addRange(range);
			}
			treeMgr.updateTreeRecord(record);

			getProgram().programTreeChanged(treeID, ProgramEvent.FRAGMENT_CHANGED, null, min, max);

		}
		finally {
			lock.release();
		}
	}
Move code units in the range to the destination fragment.
@param destFrag destination fragment
@param min min address
@param max max address
@throws NotFoundException if address range not fully contained within program memory
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/module/ModuleManager.java