/** * If accounts can't cross charts, then we need to make sure the account number is unique. * * @param accountNumber * @return */ protected boolean checkUniqueAccountNumber(String accountNumber) { boolean success = true; // while account is not allowed to cross chart // and with an account number that already exists if (!accountService.accountsCanCrossCharts() && !accountService.getAccountsForAccountNumber(accountNumber).isEmpty()) { success = false; } return success; }
@Override public boolean isValidAccount(String accountNumber) { Collection<Account> accounts = accountService.getAccountsForAccountNumber(accountNumber); return (accounts != null && !accounts.isEmpty()); }