class BulkPayment extends CommonPayment implements AccountReferenceCollector {

    @Override
    public Set<AccountReference> getAccountReferences() {
        Set<AccountReference> accountReferences = payments.stream()
                                                      .map(SinglePayment::getAccountReferences)
                                                      .flatMap(Set::stream)
                                                      .collect(Collectors.toSet());
        accountReferences.add(debtorAccount);

        return accountReferences;
    }

}