function copyChanges(aChanges, mFileNames, sContextBasedAdaptationId) {
		const aCopiedFlexObjects = [];
		aChanges.forEach(function(oChange) {
			const oCopiedChange = FlexObjectFactory.createFromFileContent(oChange.cloneFileContentWithNewId());
			const oCopiedChangeContent = oCopiedChange.getContent();
			if (oChange.getFileType() === "change") {
				if (oChange.getSelector().variantId) {
					// selector of a change links to a CompVariant
					const oCopiedChangeSelector = oCopiedChange.getSelector();
					oCopiedChangeSelector.variantId = getNewVariantId(mFileNames, oCopiedChange.getSelector().variantId);
					oCopiedChange.setSelector(oCopiedChangeSelector);
				} else if (oChange.getContent().defaultVariantName) {
					// change references to a defaultVariant
					oCopiedChangeContent.defaultVariantName = getNewVariantId(mFileNames, oCopiedChange.getContent().defaultVariantName);
					oCopiedChange.setContent(oCopiedChangeContent);
				}
				// references to a FLVariant (variant dependent change)
				if (oChange.getVariantReference()) {
					oCopiedChange.setVariantReference(getNewVariantId(mFileNames, oCopiedChange.getVariantReference()));
				}
				// Avoid adding a context for Comp again
				if (oChange.getChangeType() === "updateVariant") {
					delete oCopiedChange.getContent().contexts;
					if (!Object.keys(oCopiedChange.getContent()).length) {
						// Change got empty, not needed anymore
						return;
					}
				}
			} else if (oChange.getFileType() === "ctrl_variant_change") {
				oCopiedChange.setVariantId(getNewVariantId(mFileNames, oCopiedChange.getVariantId()));
			} else if (oChange.getFileType() === "ctrl_variant_management_change" && oChange.getContent().defaultVariant) {
				oCopiedChangeContent.defaultVariant = getNewVariantId(mFileNames, oCopiedChange.getContent().defaultVariant);
				oCopiedChange.setContent(oCopiedChangeContent);
			}
			oCopiedChange.setAdaptationId(sContextBasedAdaptationId);
			aCopiedFlexObjects.push(oCopiedChange);
		});
		return aCopiedFlexObjects;
	}
Copies changes and sets adaptationId.
Variant references are updated where needed in case the variant has been copied.
@param {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} aChanges - Changes to be copied
@param {map} mFileNames - Mapping from variants ID to new variants ID
@param {string} sContextBasedAdaptationId - Context-based adaptation ID
@returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} Returns an array of copied FlexObjects