### Question:
AccountReferenceInConsentUpdater { public void rewriteAccountAccess(@NotNull String consentId, @NotNull AccountAccess newAccountAccess, ConsentType consentType) { if (consentType == ConsentType.AIS) { aisConsentService.updateAspspAccountAccess(consentId, newAccountAccess); } else { xs2aPiisConsentService.updateAspspAccountAccess(consentId, newAccountAccess); } }  void rewriteAccountAccess(@NotNull String consentId, @NotNull AccountAccess newAccountAccess, ConsentType consentType); CmsResponse<AisConsent> updateAccountReferences(@NotNull String consentId, @NotNull AisConsent aisConsent, @NotNull List<Xs2aAccountDetails> accountDetails); CmsResponse<AisConsent> updateCardAccountReferences(String consentId, AisConsent aisConsent, List<Xs2aCardAccountDetails> accountDetails);  }### Answer:
@Test void rewriteAccountAccess_AIS() { AccountAccess accountAccess = buildXs2aAccountAccess(Collections.emptyList(), Collections.emptyList(), Collections.emptyList()); accountReferenceInConsentUpdater.rewriteAccountAccess(CONSENT_ID, accountAccess, ConsentType.AIS); verify(aisConsentService, atLeastOnce()).updateAspspAccountAccess(CONSENT_ID, accountAccess); verify(xs2aPiisConsentService, never()).updateAspspAccountAccess(CONSENT_ID, accountAccess); }
@Test void rewriteAccountAccess_PIIS() { AccountAccess accountAccess = buildXs2aAccountAccess(Collections.emptyList(), Collections.emptyList(), Collections.emptyList()); accountReferenceInConsentUpdater.rewriteAccountAccess(CONSENT_ID, accountAccess, ConsentType.PIIS_TPP); verify(xs2aPiisConsentService, atLeastOnce()).updateAspspAccountAccess(CONSENT_ID, accountAccess); verify(aisConsentService, never()).updateAspspAccountAccess(CONSENT_ID, accountAccess); }