public void makeAccounts(int n) { for (int i = 1; i < n; i++) { Account acc = new Account("Konto nr " + i, BigDecimal.ONE); acc.setId((long) i); accounts.add(acc); } }
public Account getAccountByName(List<Account> accounts, String accountName) { for (Account account : accounts) { if (account.nameProperty().get().equalsIgnoreCase(accountName)) return account; } return null; }