public Set<BankAccount> getAccountsSatisfying(Predicate<BankAccount> predicate) {
        Set<BankAccount> result = new HashSet<>();
        for (BankAccount account: accounts)
            if (predicate.test(account))
                result.add(account);
        return result;
    }