|
@@ -3,7 +3,6 @@ package rocks.zipcode.quiz5.collections;
|
3
|
3
|
import rocks.zipcode.quiz5.objectorientation.account.BankAccount;
|
4
|
4
|
|
5
|
5
|
import java.util.ArrayList;
|
6
|
|
-import java.util.List;
|
7
|
6
|
|
8
|
7
|
|
9
|
8
|
/**
|
|
@@ -13,14 +12,33 @@ public class Bank {
|
13
|
12
|
|
14
|
13
|
public BankAccount removeBankAccountByIndex(Integer indexNumber) {
|
15
|
14
|
|
|
15
|
+ ArrayList<Integer> arrayList = new ArrayList<>();
|
|
16
|
+
|
|
17
|
+ arrayList.remove(indexNumber);
|
|
18
|
+
|
16
|
19
|
return null;
|
17
|
20
|
}
|
18
|
21
|
|
19
|
22
|
public void addBankAccount(BankAccount bankAccount) {
|
20
|
23
|
|
|
24
|
+ ArrayList<BankAccount> arrayList = new ArrayList<>();
|
|
25
|
+
|
|
26
|
+ arrayList.add(bankAccount);
|
|
27
|
+
|
|
28
|
+
|
21
|
29
|
}
|
22
|
30
|
|
23
|
31
|
public Boolean containsBankAccount(BankAccount bankAccount) {
|
24
|
|
- throw new UnsupportedOperationException("Method not yet implemented");
|
|
32
|
+
|
|
33
|
+ ArrayList<BankAccount> arrayList = new ArrayList<>();
|
|
34
|
+
|
|
35
|
+ if(arrayList.contains(bankAccount)) {
|
|
36
|
+
|
|
37
|
+ return true;
|
|
38
|
+
|
|
39
|
+ } else {
|
|
40
|
+
|
|
41
|
+ return false;
|
|
42
|
+ }
|
25
|
43
|
}
|
26
|
44
|
}
|