private CheckingAccount createCheckingAccountWithRandomTransactions( String accountNumber, String accountName, AccountManager manager, Integer target) { CheckingAccount account = createCheckingAccount(accountNumber, accountName, manager, true); Random random = new Random(); while (account.getBalance() > target) { manager.withdraw(account, 1 + random.nextInt(50)); } return account; }
private CheckingAccount createCheckingAccount( String accountNumber, String accountName, AccountManager manager, Boolean canOverdraw) { CheckingAccount account = new CheckingAccount(accountNumber, accountName, canOverdraw); manager.deposit(account, 100); return account; }
private SavingsAccount createSavingsAccount( String accountNumber, String accountName, AccountManager manager) { SavingsAccount account = new SavingsAccount(accountNumber, accountName); manager.deposit(account, 100); return account; }