### Question:
AccessMapper { public List<TppAccountAccess> mapToTppAccountAccess(AccountAccess accountAccess) { List<TppAccountAccess> tppAccountAccesses = new ArrayList<>(); tppAccountAccesses.addAll(accountAccess.getAccounts().stream().map(a -> new TppAccountAccess(a.getUsedAccountReferenceSelector().getAccountValue(), TypeAccess.ACCOUNT, a.getUsedAccountReferenceSelector().getAccountReferenceType(), a.getCurrency())).collect(Collectors.toList())); tppAccountAccesses.addAll(accountAccess.getBalances().stream().map(a -> new TppAccountAccess(a.getUsedAccountReferenceSelector().getAccountValue(), TypeAccess.BALANCE, a.getUsedAccountReferenceSelector().getAccountReferenceType(), a.getCurrency())).collect(Collectors.toList())); tppAccountAccesses.addAll(accountAccess.getTransactions().stream().map(a -> new TppAccountAccess(a.getUsedAccountReferenceSelector().getAccountValue(), TypeAccess.TRANSACTION, a.getUsedAccountReferenceSelector().getAccountReferenceType(), a.getCurrency())).collect(Collectors.toList())); AdditionalInformationAccess additionalInformationAccess = accountAccess.getAdditionalInformationAccess(); if (additionalInformationAccess != null) { if (CollectionUtils.isNotEmpty(additionalInformationAccess.getOwnerName())) { tppAccountAccesses.addAll(additionalInformationAccess.getOwnerName().stream().map(a -> new TppAccountAccess(a.getUsedAccountReferenceSelector().getAccountValue(), TypeAccess.OWNER_NAME, a.getUsedAccountReferenceSelector().getAccountReferenceType(), a.getCurrency())).collect(Collectors.toList())); } if (CollectionUtils.isNotEmpty(additionalInformationAccess.getTrustedBeneficiaries())) { tppAccountAccesses.addAll(additionalInformationAccess.getTrustedBeneficiaries().stream().map(a -> new TppAccountAccess(a.getUsedAccountReferenceSelector().getAccountValue(), TypeAccess.BENEFICIARIES, a.getUsedAccountReferenceSelector().getAccountReferenceType(), a.getCurrency())).collect(Collectors.toList())); } } return tppAccountAccesses; }  AccountAccess mapTppAccessesToAccountAccess(List<TppAccountAccess> tppAccountAccesses,
                                                       AdditionalAccountInformationType ownerNameType,
                                                       AdditionalAccountInformationType trustedBeneficiariesType); AccountAccess mapAspspAccessesToAccountAccess(List<AspspAccountAccess> aspspAccountAccesses,
                                                         AdditionalAccountInformationType ownerNameType,
                                                         AdditionalAccountInformationType trustedBeneficiariesType); List<TppAccountAccess> mapToTppAccountAccess(AccountAccess accountAccess); List<AspspAccountAccess> mapToAspspAccountAccess(AccountAccess accountAccess); AspspAccountAccess mapToAspspAccountAccess(AccountReference accountReference); AccountReference mapToAccountReference(AspspAccountAccess aspspAccountAccess);  }### Answer:
@Test void mapToTppAccountAccess() { AccountAccess accountAccess = jsonReader.getObjectFromFile("json/service/mapper/access-mapper/account-access-for-tpp-additional-information.json", AccountAccess.class); List<TppAccountAccess> actual = accessMapper.mapToTppAccountAccess(accountAccess); List<TppAccountAccess> expected = jsonReader.getListFromFile("json/service/mapper/access-mapper/tpp-account-accesses-additional-information.json", TppAccountAccess.class); assertEquals(expected, actual); }