Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public BigDecimal accountBalance(User user) {
- return bank.getAllAccounts()
- .stream()
- .filter(acc -> acc.getOwner().equals(user))
- .findFirst()
- .orElseThrow(() -> new RuntimeException("Not found"))
- .getAccountBalance();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement