function deepEqual(aExpected) {
			assert.strictEqual(oCache.aElements, aElements, "same ref");
			assert.deepEqual(oCache.aElements, aExpected);
		}
******************************************************************************************
[false, true].forEach((bBeforeUpdateSelected) => {
	[false, true].forEach((bBeforeRequestSideEffects) => {
		const sTitle = "CollectionCache#requestSideEffects: bSingle; #beforeUpdateSelected="
			+ bBeforeUpdateSelected + ", #beforeRequestSideEffects="
			+ bBeforeRequestSideEffects;

	QUnit.test(sTitle, async function () {
		const oCache = this.createCache("TEAMS('42')/Foo");
		this.mock(oCache).expects("getTypes").withExactArgs().returns("~mTypeForMetaPath~");
		this.mock(oCache).expects("checkSharedRequest").withExactArgs();
		const mQueryOptions = {
			$apply : "A.P.P.L.E.", // must be kept
			$count : true, // dropped
			$expand : {expand : null},
			$filter : "filter", // dropped
			$orderby : "orderby", // dropped
			$search : "search", // dropped
			$select : ["Name"],
			foo : "bar",
			"sap-client" : "123"
		};
		this.mock(Object).expects("assign")
			.withExactArgs({}, sinon.match.same(oCache.mQueryOptions),
				sinon.match.same(oCache.mLateQueryOptions))
			.returns("~mQueryOptions~");
		this.mock(_Helper).expects("intersectQueryOptions")
			.withExactArgs("~mQueryOptions~", "~aPaths~",
				sinon.match.same(this.oRequestor.getModelInterface().fetchMetadata),
				"/TEAMS/Foo", "", "~bWithMessages~")
			.returns(mQueryOptions);
		oCache.beforeRequestSideEffects = bBeforeRequestSideEffects
			? function (mQueryOptions0) {
				mQueryOptions0.foo = "baz";
			}
			: undefined;
		this.mock(oCache).expects("keepOnlyGivenElements").never();
		this.mock(_Helper).expects("getKeyFilter").never();
		this.mock(_Helper).expects("selectKeyProperties").never();
		const mExpectedQueryOptions = {
			$apply : "A.P.P.L.E.",
			$expand : {expand : null},
			$select : ["Name"],
			foo : bBeforeRequestSideEffects ? "baz" : "bar",
			"sap-client" : "123"
		};
		const oExtractMergeableQueryOptionsExpectation
			 = this.mock(_Helper).expects("extractMergeableQueryOptions")
				.withExactArgs(mExpectedQueryOptions).returns("~mMergeableQueryOptions~");
		const oBuildQueryStringExpectation = this.mock(this.oRequestor).expects("buildQueryString")
			.withExactArgs("/TEAMS/Foo", mExpectedQueryOptions, false, true).returns("?bar");
		this.oRequestorMock.expects("request").withExactArgs("GET", "TEAMS('42')/Foo('a')?bar",
				"~oGroupLock~", undefined, undefined, undefined, undefined, oCache.sMetaPath,
				undefined, false, "~mMergeableQueryOptions~", sinon.match.same(oCache),
				sinon.match.func)
			.resolves("~oResult~");
		this.mock(oCache).expects("visitResponse")
			.withExactArgs("~oResult~", "~mTypeForMetaPath~", undefined, "('a')", undefined, true);
		oCache.beforeUpdateSelected = bBeforeUpdateSelected ? mustBeMocked : undefined;
		if (bBeforeUpdateSelected) {
			this.mock(oCache).expects("beforeUpdateSelected").withExactArgs("('a')", "~oResult~");
		}
		oCache.aElements.$byPredicate["('a')"] = "~oOldElement~";
		this.mock(_Helper).expects("updateSelected")
			.withExactArgs(sinon.match.same(oCache.mChangeListeners), "('a')", "~oOldElement~",
				"~oResult~", "~aPaths~", sinon.match.func);

		// code under test
		await oCache.requestSideEffects("~oGroupLock~", "~aPaths~", ["('a')", "n/a"],
			/*bSingle