function buildPatchResponse(aMatches, _oResponse, oRequest) {
		/**
		 * Adjust the DistanceFromRoot of the given node (and all of its descendants) by the given
		 * difference.
		 *
		 * @param {object} oNode - A node
		 * @param {number} iDiff - Some difference
		 */
		function adjustDistanceFromRoot(oNode, iDiff) {
			oNode.DistanceFromRoot += iDiff;
			(mChildrenByParentId[oNode.ID] || [])
				.forEach((oChild) => { adjustDistanceFromRoot(oChild, iDiff); });
		}

		function findLastIndex(aArray, fnPredicate) {
			return aArray.reduce((iLast, oItem, i) => (fnPredicate(oItem) ? i : iLast), -1);
		}

		if (oRequest.requestHeaders.Prefer !== "return=minimal") {
			throw new Error("Unsupported Prefer header: " + oRequest.requestHeaders.Prefer);
		}
		// {"Name" : "<new name>"}
		// "EMPLOYEE_2_MANAGER@odata.bind" : "EMPLOYEES('1')"
		const oBody = JSON.parse(oRequest.requestBody);
		switch (Object.keys(oBody).length === 1 && Object.keys(oBody)[0]) {
			case "EMPLOYEE_2_MANAGER@odata.bind": {
				const oChild = mNodeById[aMatches[1]];
				if (oChild.Name.includes("ERROR")) {
					throw new Error("This request intentionally failed!");
				}

				const sParentId = oBody["EMPLOYEE_2_MANAGER@odata.bind"]
					?.slice("EMPLOYEES('".length, -"')".length) ?? null;
				if (sParentId) {
					for (let sId = sParentId; sId; sId = mNodeById[sId].MANAGER_ID) {
						if (sId === oChild.ID) { // cycle detected
							throw new Error("Parent must not be a descendant of moved node");
						}
					}
				}

				if (oChild.MANAGER_ID) {
					const aChildren = mChildrenByParentId[oChild.MANAGER_ID];
					aChildren.splice(aChildren.indexOf(oChild), 1);
					if (!aChildren.length) { // last child has gone
						delete mChildrenByParentId[oChild.MANAGER_ID];
						mNodeById[oChild.MANAGER_ID].DrillState = "leaf";
					}
					adjustDescendantCount(oChild.MANAGER_ID, -(oChild.DescendantCount + 1));
				}

				const aSpliced
					= aAllNodes.splice(aAllNodes.indexOf(oChild), oChild.DescendantCount + 1);
				let iNewIndex; // Note: "AGE determines sibling order (ascending)"
				if (sParentId) {
					if (!(sParentId in mChildrenByParentId)) {
						// new parent not a leaf anymore
						mNodeById[sParentId].DrillState = "collapsed"; // @see #reset
						mChildrenByParentId[sParentId] = [];
					}
					adjustDescendantCount(sParentId, oChild.DescendantCount + 1);
					const iLastYounger = findLastIndex(mChildrenByParentId[sParentId],
						(oSibling) => oSibling.AGE < oChild.AGE); // Note: might be -1
					mChildrenByParentId[sParentId].splice(iLastYounger + 1, 0, oChild);
					if (iLastYounger < 0) { // right after parent
						iNewIndex = aAllNodes.indexOf(mNodeById[sParentId]) + 1;
					} else { // just after last younger sibling's descendants!
						const oLastYounger = mChildrenByParentId[sParentId][iLastYounger];
						iNewIndex
							= aAllNodes.indexOf(oLastYounger) + oLastYounger.DescendantCount + 1;
					}
				} else { // find last younger root
					const iLastYounger = findLastIndex(aAllNodes,
						(oNode) => !oNode.MANAGER_ID && oNode.AGE < oChild.AGE); // might be -1
					iNewIndex = iLastYounger < 0
						? 0
						: iLastYounger + aAllNodes[iLastYounger].DescendantCount + 1;
				}
				aAllNodes.splice(iNewIndex, 0, ...aSpliced);

				oChild.MANAGER_ID = sParentId;
				const iParentDistanceFromRoot = sParentId
					? mNodeById[sParentId].DistanceFromRoot
					: -1;
				adjustDistanceFromRoot(oChild,
					iParentDistanceFromRoot + 1 - oChild.DistanceFromRoot);
				break;
			}

			case "Name":
				// ignore suffixes added by SandboxModel.update
				mNodeById[aMatches[1]].Name = oBody.Name.split(" #")[0];
				// side effect for single row
				mRevisionOfAgeById[aMatches[1]] += 1;
				break;

			default:
				throw new Error("Unsupported PATCH body: " + oRequest.requestBody);
		}
		// no response required
	}
Builds a response for any PATCH request on a specific "EMPLOYEE" instance.

@param {string[]} aMatches - The matches against the RegExp
@param {object} _oResponse - Response object to fill
@param {object} oRequest - Request object to get PATCH body from