class PaymentAccountReferenceExtractor {

    public Set<AccountReference> extractAccountReferences(byte[] paymentBody, PaymentType paymentType) {
        Optional<AccountReferenceCollector> accountReferenceCollector = mapToAccountReferenceCollector(paymentBody, paymentType);
        return accountReferenceCollector
                   .map(AccountReferenceCollector::getAccountReferences)
                   .orElse(Collections.emptySet());
    }

}