class AccessMapper {

    public AccountAccess mapTppAccessesToAccountAccess(List<TppAccountAccess> tppAccountAccesses,
                                                       AdditionalAccountInformationType ownerNameType,
                                                       AdditionalAccountInformationType trustedBeneficiariesType) {
        AccountAccessListHolder holder = new AccountAccessListHolder();
        tppAccountAccesses.forEach(a -> {
            AccountReference accountReference = new AccountReference(a.getAccountReferenceType(),
                                                                     a.getAccountIdentifier(),
                                                                     a.getCurrency());
            holder.addAccountReference(accountReference, a.getTypeAccess());
        });
        return buildAccountAccess(holder, ownerNameType, trustedBeneficiariesType);
    }

}