### Question:
PaymentAccounts { @Nullable PaymentAccount getOldestPaymentAccountForOffer(Offer offer) { List<PaymentAccount> sortedValidAccounts = sortValidAccounts(offer); logAccounts(sortedValidAccounts); return firstOrNull(sortedValidAccounts); } PaymentAccounts(Set<PaymentAccount> accounts, AccountAgeWitnessService accountAgeWitnessService);   PaymentAccounts(Set<PaymentAccount> accounts, AccountAgeWitnessService accountAgeWitnessService,
                    BiFunction<Offer, PaymentAccount, Boolean> validator);   }### Answer:
@Test public void testGetOldestPaymentAccountForOfferWhenNoValidAccounts() { PaymentAccounts accounts = new PaymentAccounts(Collections.emptySet(), mock(AccountAgeWitnessService.class)); PaymentAccount actual = accounts.getOldestPaymentAccountForOffer(mock(Offer.class)); assertNull(actual); }