public function withAddedInvocationRecord($methodName, Dictionary $newInvocationRecord) {
        $recordedInvocationsOfGivenMethod =
            isset($this->methodNameToInvocationRecordsMap[$methodName])
                ? $this->methodNameToInvocationRecordsMap[$methodName]
                : new UnorderedList();

        $invocationRecordToAdd = $newInvocationRecord->withValue(
            'previouslyRecordedInvocationRecord',
            $this->lastRecordedInvocationRecord
        );

        return new static(
            $this->methodNameToInvocationRecordsMap->withValue(
                $methodName,
                $recordedInvocationsOfGivenMethod->withValue(
                    $invocationRecordToAdd
                )
            ),
            $invocationRecordToAdd
        );
    }