File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed
lesson_17/bank/bank_app/src/main/java/com/codedifferently/lesson17/bank Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -18,21 +18,7 @@ public class BankAtm {
18
18
*
19
19
* @param account The account to add.
20
20
*/
21
- public void addAccount (CheckingAccount account ) {
22
- if (account instanceof BusinessCheckingAccount ) {
23
- boolean hasBusinessAccount = false ;
24
- for (Customer owner : account .getOwners ()) {
25
- Customer customer = customerById .get (owner .getId ());
26
- if (customer != null && customer .hasBusinessAccount ()) {
27
- hasBusinessAccount = true ;
28
- break ;
29
- }
30
- }
31
- if (!hasBusinessAccount ) {
32
- throw new IllegalArgumentException ("At least one owning account must be a business account." );
33
- }
34
- }
35
-
21
+ public void addAccount (CheckingAccount account ) {
36
22
accountByNumber .put (account .getAccountNumber (), account );
37
23
account
38
24
.getOwners ()
You can’t perform that action at this time.
0 commit comments