class TrustedBeneficiariesModelMapper {

    public TrustedBeneficiariesList mapToTrustedBeneficiariesList(Xs2aTrustedBeneficiariesList xs2ATrustedBeneficiariesList) {
        List<Xs2aTrustedBeneficiaries> trustedBeneficiaries = xs2ATrustedBeneficiariesList.getTrustedBeneficiaries();

        List<TrustedBeneficiary> beneficiaries = trustedBeneficiaries.stream()
                                                     .map(this::mapToTrustedBeneficiaries)
                                                     .collect(Collectors.toList());

        TrustedBeneficiariesList result = new TrustedBeneficiariesList();
        result.addAll(beneficiaries);
        return result;
    }

}