function copyVariants(aVariants, mFileNames, sContextBasedAdaptationId) {
		var aCopiedFlexObjects = [];
		aVariants.forEach(function(oVariant) {
			var oCopiedVariant = FlexObjectFactory.createFromFileContent(oVariant.cloneFileContentWithNewId());
			oCopiedVariant.setAdaptationId(sContextBasedAdaptationId);
			oCopiedVariant.setContexts();
			// Remember mapping of original variant ID to ID of copy
			mFileNames.set(oVariant.getId(), oCopiedVariant.getId());
			aCopiedFlexObjects.push(oCopiedVariant);
		});
		return aCopiedFlexObjects;
	}
Copies CompVariants and FLVariants and sets adaptationId.
@param {sap.ui.fl.apply._internal.flexObjects.Variant[]} aVariants - Variants to be copied
@param {map} mFileNames - Mapping from old variants ID to new variants ID for changes
@param {string} sContextBasedAdaptationId - Context-based adaptation ID
@returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} Returns an array of copied variants as FlexObject