### Question:
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; }  @Override Set<AccountReference> getAccountReferences(); @Override PaymentType getPaymentType();  }### Answer:
@Test void getAccountReferences_shouldReturnAllReferences() { BulkPayment bulkPayment = buildBulkPayment(Collections.singletonList(buildSinglePayment())); Set<AccountReference> actualAccountReferences = bulkPayment.getAccountReferences(); Set<AccountReference> expectedAccountReferences = new HashSet<>(Arrays.asList(DEBTOR_ACCOUNT_1, DEBTOR_ACCOUNT_2, CREDITOR_ACCOUNT)); assertEquals(expectedAccountReferences, actualAccountReferences); }