### Question:
PiisConsent extends Consent<PiisConsentData> { public AccountReference getAccountReference() { List<AccountReference> accounts = getAspspAccountAccesses().getAccounts(); if (CollectionUtils.isNotEmpty(accounts)) { return accounts.get(0); } List<AccountReference> tppAccounts = getTppAccountAccesses().getAccounts(); if (CollectionUtils.isNotEmpty(tppAccounts)) { return tppAccounts.get(0); } return null; } PiisConsent();  PiisConsent(ConsentType consentType); AccountReference getAccountReference(); PsuIdData getPsuIdData();  }### Answer:
@Test void getAccountReference() { PiisConsent piisConsent = jsonReader.getObjectFromFile("json/data/piis/piis-consent.json", PiisConsent.class); AccountReference accountReference = jsonReader.getObjectFromFile("json/data/piis/account-reference.json", AccountReference.class); assertEquals(accountReference, piisConsent.getAccountReference()); }
@Test void getAccountReference_aspspAccountsEmpty() { PiisConsent piisConsent = jsonReader.getObjectFromFile("json/data/piis/piis-consent.json", PiisConsent.class); piisConsent.setTppAccountAccesses(piisConsent.getAspspAccountAccesses()); piisConsent.setAspspAccountAccesses(AccountAccess.EMPTY_ACCESS); AccountReference expectedAccountReference = jsonReader.getObjectFromFile("json/data/piis/account-reference.json", AccountReference.class); AccountReference actualAccountReference = piisConsent.getAccountReference(); assertEquals(expectedAccountReference, actualAccountReference); }