public function assignAccountToParty(Account $account, AbstractParty $party)
    {
        if ($party->getAccounts()->contains($account)) {
            return;
        }
        $party->addAccount($account);

        $accountIdentifier = $this->persistenceManager->getIdentifierByObject($account);
        // We need to prevent stale object references and therefore only cache the identifier.
        $this->accountsInPartyRuntimeCache[$accountIdentifier] = $this->persistenceManager->getIdentifierByObject($party);
    }