Browse Source

{almost done part1}

Jacqueline Joson 6 years ago
parent
commit
e8f7711c17
3 changed files with 152 additions and 77 deletions
  1. 71
    69
      .idea/workspace.xml
  2. 19
    5
      src/main/java/MyArrayList.java
  3. 62
    3
      src/test/java/MyArrayListTest.java

+ 71
- 69
.idea/workspace.xml View File

2
 <project version="4">
2
 <project version="4">
3
   <component name="ChangeListManager">
3
   <component name="ChangeListManager">
4
     <list default="true" id="ada34df4-dfd8-4fb3-8f80-b9a79b2fcc05" name="Default Changelist" comment="">
4
     <list default="true" id="ada34df4-dfd8-4fb3-8f80-b9a79b2fcc05" name="Default Changelist" comment="">
5
-      <change beforePath="$PROJECT_DIR$/src/main/java/.deleteme" beforeDir="false" />
6
-      <change beforePath="$PROJECT_DIR$/src/test/java/.deleteme" beforeDir="false" />
5
+      <change beforePath="$PROJECT_DIR$/src/main/java/MyArrayList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" afterDir="false" />
7
     </list>
7
     </list>
8
     <ignored path="$PROJECT_DIR$/target/" />
8
     <ignored path="$PROJECT_DIR$/target/" />
9
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
9
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
42
       </usages-collector>
42
       </usages-collector>
43
       <usages-collector id="statistics.file.extensions.edit">
43
       <usages-collector id="statistics.file.extensions.edit">
44
         <counts>
44
         <counts>
45
-          <entry key="java" value="2864" />
45
+          <entry key="java" value="3930" />
46
           <entry key="txt" value="59" />
46
           <entry key="txt" value="59" />
47
         </counts>
47
         </counts>
48
       </usages-collector>
48
       </usages-collector>
49
       <usages-collector id="statistics.file.types.edit">
49
       <usages-collector id="statistics.file.types.edit">
50
         <counts>
50
         <counts>
51
-          <entry key="JAVA" value="2864" />
51
+          <entry key="JAVA" value="3930" />
52
           <entry key="PLAIN_TEXT" value="59" />
52
           <entry key="PLAIN_TEXT" value="59" />
53
         </counts>
53
         </counts>
54
       </usages-collector>
54
       </usages-collector>
66
           </provider>
66
           </provider>
67
         </entry>
67
         </entry>
68
       </file>
68
       </file>
69
-      <file pinned="false" current-in-tab="true">
69
+      <file pinned="false" current-in-tab="false">
70
         <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
70
         <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
71
           <provider selected="true" editor-type-id="text-editor">
71
           <provider selected="true" editor-type-id="text-editor">
72
-            <state relative-caret-position="345">
73
-              <caret line="48" column="9" lean-forward="true" selection-start-line="48" selection-start-column="9" selection-end-line="48" selection-end-column="9" />
72
+            <state relative-caret-position="217">
73
+              <caret line="78" column="13" lean-forward="true" selection-start-line="78" selection-start-column="13" selection-end-line="78" selection-end-column="13" />
74
               <folding>
74
               <folding>
75
                 <element signature="e#67#68#0" expanded="true" />
75
                 <element signature="e#67#68#0" expanded="true" />
76
                 <element signature="e#107#108#0" expanded="true" />
76
                 <element signature="e#107#108#0" expanded="true" />
77
                 <element signature="e#216#217#0" expanded="true" />
77
                 <element signature="e#216#217#0" expanded="true" />
78
                 <element signature="e#250#251#0" expanded="true" />
78
                 <element signature="e#250#251#0" expanded="true" />
79
-                <element signature="e#1330#1331#0" expanded="true" />
80
-                <element signature="e#1366#1367#0" expanded="true" />
81
-                <element signature="e#1419#1420#0" expanded="true" />
82
-                <element signature="e#1455#1456#0" expanded="true" />
83
-                <element signature="e#1484#1485#0" expanded="true" />
84
-                <element signature="e#1529#1530#0" expanded="true" />
79
+                <element signature="e#1551#1552#0" expanded="true" />
80
+                <element signature="e#1596#1597#0" expanded="true" />
85
               </folding>
81
               </folding>
86
             </state>
82
             </state>
87
           </provider>
83
           </provider>
88
         </entry>
84
         </entry>
89
       </file>
85
       </file>
90
-      <file pinned="false" current-in-tab="false">
86
+      <file pinned="false" current-in-tab="true">
91
         <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
87
         <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
92
           <provider selected="true" editor-type-id="text-editor">
88
           <provider selected="true" editor-type-id="text-editor">
93
-            <state relative-caret-position="704">
94
-              <caret line="49" column="20" lean-forward="true" selection-start-line="49" selection-start-column="20" selection-end-line="49" selection-end-column="20" />
89
+            <state relative-caret-position="254">
90
+              <caret line="134" column="40" lean-forward="true" selection-start-line="134" selection-start-column="40" selection-end-line="134" selection-end-column="40" />
95
               <folding>
91
               <folding>
96
                 <element signature="imports" expanded="true" />
92
                 <element signature="imports" expanded="true" />
97
                 <element signature="e#282#291#0" expanded="true" />
93
                 <element signature="e#282#291#0" expanded="true" />
216
   <component name="PropertiesComponent">
212
   <component name="PropertiesComponent">
217
     <property name="WebServerToolWindowFactoryState" value="false" />
213
     <property name="WebServerToolWindowFactoryState" value="false" />
218
     <property name="aspect.path.notification.shown" value="true" />
214
     <property name="aspect.path.notification.shown" value="true" />
219
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542324893948" />
215
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542340110766" />
220
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
216
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
221
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit4" value="" />
217
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit4" value="" />
222
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
218
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
247
       </list>
243
       </list>
248
     </option>
244
     </option>
249
   </component>
245
   </component>
250
-  <component name="RunManager" selected="JUnit.MyArrayListTest.clearTest">
251
-    <configuration name="MyArrayListTest.addIntTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
246
+  <component name="RunManager" selected="JUnit.MyArrayListTest.addOverrideTest">
247
+    <configuration name="MyArrayListTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
248
+      <module name="generics" />
249
+      <option name="PACKAGE_NAME" value="" />
250
+      <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
251
+      <method v="2">
252
+        <option name="Make" enabled="true" />
253
+      </method>
254
+    </configuration>
255
+    <configuration name="MyArrayListTest.addOverrideTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
252
       <module name="generics" />
256
       <module name="generics" />
253
       <option name="PACKAGE_NAME" value="" />
257
       <option name="PACKAGE_NAME" value="" />
254
       <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
258
       <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
255
-      <option name="METHOD_NAME" value="addIntTest" />
259
+      <option name="METHOD_NAME" value="addOverrideTest" />
256
       <option name="TEST_OBJECT" value="method" />
260
       <option name="TEST_OBJECT" value="method" />
257
       <method v="2">
261
       <method v="2">
258
         <option name="Make" enabled="true" />
262
         <option name="Make" enabled="true" />
259
       </method>
263
       </method>
260
     </configuration>
264
     </configuration>
261
-    <configuration name="MyArrayListTest.clearTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
265
+    <configuration name="MyArrayListTest.containsFalseTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
262
       <module name="generics" />
266
       <module name="generics" />
263
       <option name="PACKAGE_NAME" value="" />
267
       <option name="PACKAGE_NAME" value="" />
264
       <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
268
       <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
265
-      <option name="METHOD_NAME" value="clearTest" />
269
+      <option name="METHOD_NAME" value="containsFalseTest" />
266
       <option name="TEST_OBJECT" value="method" />
270
       <option name="TEST_OBJECT" value="method" />
267
       <method v="2">
271
       <method v="2">
268
         <option name="Make" enabled="true" />
272
         <option name="Make" enabled="true" />
269
       </method>
273
       </method>
270
     </configuration>
274
     </configuration>
271
-    <configuration name="MyArrayListTest.getTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
275
+    <configuration name="MyArrayListTest.containsTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
272
       <module name="generics" />
276
       <module name="generics" />
273
       <option name="PACKAGE_NAME" value="" />
277
       <option name="PACKAGE_NAME" value="" />
274
       <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
278
       <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
275
-      <option name="METHOD_NAME" value="getTest" />
279
+      <option name="METHOD_NAME" value="containsTest" />
276
       <option name="TEST_OBJECT" value="method" />
280
       <option name="TEST_OBJECT" value="method" />
277
       <method v="2">
281
       <method v="2">
278
         <option name="Make" enabled="true" />
282
         <option name="Make" enabled="true" />
279
       </method>
283
       </method>
280
     </configuration>
284
     </configuration>
281
-    <configuration name="MyArrayListTest.setTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
285
+    <configuration name="MyArrayListTest.isEmptyTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
282
       <module name="generics" />
286
       <module name="generics" />
283
       <option name="PACKAGE_NAME" value="" />
287
       <option name="PACKAGE_NAME" value="" />
284
       <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
288
       <option name="MAIN_CLASS_NAME" value="MyArrayListTest" />
285
-      <option name="METHOD_NAME" value="setTest" />
289
+      <option name="METHOD_NAME" value="isEmptyTest" />
286
       <option name="TEST_OBJECT" value="method" />
290
       <option name="TEST_OBJECT" value="method" />
287
       <method v="2">
291
       <method v="2">
288
         <option name="Make" enabled="true" />
292
         <option name="Make" enabled="true" />
289
       </method>
293
       </method>
290
     </configuration>
294
     </configuration>
291
     <list>
295
     <list>
292
-      <item itemvalue="JUnit.MyArrayListTest.addIntTest" />
293
-      <item itemvalue="JUnit.MyArrayListTest.getTest" />
294
-      <item itemvalue="JUnit.MyArrayListTest.setTest" />
295
-      <item itemvalue="JUnit.MyArrayListTest.clearTest" />
296
+      <item itemvalue="JUnit.MyArrayListTest" />
297
+      <item itemvalue="JUnit.MyArrayListTest.isEmptyTest" />
298
+      <item itemvalue="JUnit.MyArrayListTest.containsTest" />
299
+      <item itemvalue="JUnit.MyArrayListTest.containsFalseTest" />
300
+      <item itemvalue="JUnit.MyArrayListTest.addOverrideTest" />
296
     </list>
301
     </list>
297
     <recent_temporary>
302
     <recent_temporary>
298
       <list>
303
       <list>
299
-        <item itemvalue="JUnit.MyArrayListTest.clearTest" />
300
-        <item itemvalue="JUnit.MyArrayListTest.setTest" />
301
-        <item itemvalue="JUnit.MyArrayListTest.addIntTest" />
302
-        <item itemvalue="JUnit.MyArrayListTest.getTest" />
304
+        <item itemvalue="JUnit.MyArrayListTest.addOverrideTest" />
305
+        <item itemvalue="JUnit.MyArrayListTest.containsFalseTest" />
306
+        <item itemvalue="JUnit.MyArrayListTest.containsTest" />
307
+        <item itemvalue="JUnit.MyArrayListTest" />
308
+        <item itemvalue="JUnit.MyArrayListTest.isEmptyTest" />
303
       </list>
309
       </list>
304
     </recent_temporary>
310
     </recent_temporary>
305
   </component>
311
   </component>
313
       <option name="number" value="Default" />
319
       <option name="number" value="Default" />
314
       <option name="presentableId" value="Default" />
320
       <option name="presentableId" value="Default" />
315
       <updated>1542236797011</updated>
321
       <updated>1542236797011</updated>
316
-      <workItem from="1542236798436" duration="14202000" />
322
+      <workItem from="1542236798436" duration="16476000" />
317
     </task>
323
     </task>
318
     <servers />
324
     <servers />
319
   </component>
325
   </component>
320
   <component name="TestHistory">
326
   <component name="TestHistory">
321
-    <history-entry file="MyArrayListTest_setTest - 2018.11.15 at 18h 04m 25s.xml">
322
-      <configuration name="MyArrayListTest.setTest" configurationId="JUnit" />
323
-    </history-entry>
324
-    <history-entry file="MyArrayListTest_setTest - 2018.11.15 at 18h 04m 54s.xml">
325
-      <configuration name="MyArrayListTest.setTest" configurationId="JUnit" />
326
-    </history-entry>
327
-    <history-entry file="MyArrayListTest_setTest - 2018.11.15 at 18h 06m 07s.xml">
328
-      <configuration name="MyArrayListTest.setTest" configurationId="JUnit" />
329
-    </history-entry>
330
-    <history-entry file="MyArrayListTest_setTest - 2018.11.15 at 18h 07m 57s.xml">
331
-      <configuration name="MyArrayListTest.setTest" configurationId="JUnit" />
332
-    </history-entry>
333
-    <history-entry file="MyArrayListTest_setTest - 2018.11.15 at 18h 08m 04s.xml">
334
-      <configuration name="MyArrayListTest.setTest" configurationId="JUnit" />
335
-    </history-entry>
336
     <history-entry file="MyArrayListTest_setTest - 2018.11.15 at 18h 18m 10s.xml">
327
     <history-entry file="MyArrayListTest_setTest - 2018.11.15 at 18h 18m 10s.xml">
337
       <configuration name="MyArrayListTest.setTest" configurationId="JUnit" />
328
       <configuration name="MyArrayListTest.setTest" configurationId="JUnit" />
338
     </history-entry>
329
     </history-entry>
348
     <history-entry file="MyArrayListTest_clearTest - 2018.11.15 at 18h 34m 39s.xml">
339
     <history-entry file="MyArrayListTest_clearTest - 2018.11.15 at 18h 34m 39s.xml">
349
       <configuration name="MyArrayListTest.clearTest" configurationId="JUnit" />
340
       <configuration name="MyArrayListTest.clearTest" configurationId="JUnit" />
350
     </history-entry>
341
     </history-entry>
342
+    <history-entry file="MyArrayListTest - 2018.11.15 at 22h 13m 39s.xml">
343
+      <configuration name="MyArrayListTest" configurationId="JUnit" />
344
+    </history-entry>
345
+    <history-entry file="MyArrayListTest_isEmptyTest - 2018.11.15 at 22h 21m 29s.xml">
346
+      <configuration name="MyArrayListTest.isEmptyTest" configurationId="JUnit" />
347
+    </history-entry>
348
+    <history-entry file="MyArrayListTest - 2018.11.15 at 22h 23m 27s.xml">
349
+      <configuration name="MyArrayListTest" configurationId="JUnit" />
350
+    </history-entry>
351
+    <history-entry file="MyArrayListTest_containsTest - 2018.11.15 at 22h 31m 02s.xml">
352
+      <configuration name="MyArrayListTest.containsTest" configurationId="JUnit" />
353
+    </history-entry>
354
+    <history-entry file="MyArrayListTest_containsFalseTest - 2018.11.15 at 22h 31m 53s.xml">
355
+      <configuration name="MyArrayListTest.containsFalseTest" configurationId="JUnit" />
356
+    </history-entry>
351
   </component>
357
   </component>
352
   <component name="TimeTrackingManager">
358
   <component name="TimeTrackingManager">
353
-    <option name="totallyTimeSpent" value="14202000" />
359
+    <option name="totallyTimeSpent" value="16476000" />
354
   </component>
360
   </component>
355
   <component name="ToolWindowManager">
361
   <component name="ToolWindowManager">
356
     <frame x="0" y="23" width="1280" height="712" extended-state="0" />
362
     <frame x="0" y="23" width="1280" height="712" extended-state="0" />
491
         </state>
497
         </state>
492
       </provider>
498
       </provider>
493
     </entry>
499
     </entry>
494
-    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
500
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
495
       <provider selected="true" editor-type-id="text-editor">
501
       <provider selected="true" editor-type-id="text-editor">
496
-        <state relative-caret-position="704">
497
-          <caret line="49" column="20" lean-forward="true" selection-start-line="49" selection-start-column="20" selection-end-line="49" selection-end-column="20" />
502
+        <state relative-caret-position="217">
503
+          <caret line="78" column="13" lean-forward="true" selection-start-line="78" selection-start-column="13" selection-end-line="78" selection-end-column="13" />
498
           <folding>
504
           <folding>
499
-            <element signature="imports" expanded="true" />
500
-            <element signature="e#282#291#0" expanded="true" />
505
+            <element signature="e#67#68#0" expanded="true" />
506
+            <element signature="e#107#108#0" expanded="true" />
507
+            <element signature="e#216#217#0" expanded="true" />
508
+            <element signature="e#250#251#0" expanded="true" />
509
+            <element signature="e#1551#1552#0" expanded="true" />
510
+            <element signature="e#1596#1597#0" expanded="true" />
501
           </folding>
511
           </folding>
502
         </state>
512
         </state>
503
       </provider>
513
       </provider>
504
     </entry>
514
     </entry>
505
-    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
515
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
506
       <provider selected="true" editor-type-id="text-editor">
516
       <provider selected="true" editor-type-id="text-editor">
507
-        <state relative-caret-position="345">
508
-          <caret line="48" column="9" lean-forward="true" selection-start-line="48" selection-start-column="9" selection-end-line="48" selection-end-column="9" />
517
+        <state relative-caret-position="254">
518
+          <caret line="134" column="40" lean-forward="true" selection-start-line="134" selection-start-column="40" selection-end-line="134" selection-end-column="40" />
509
           <folding>
519
           <folding>
510
-            <element signature="e#67#68#0" expanded="true" />
511
-            <element signature="e#107#108#0" expanded="true" />
512
-            <element signature="e#216#217#0" expanded="true" />
513
-            <element signature="e#250#251#0" expanded="true" />
514
-            <element signature="e#1330#1331#0" expanded="true" />
515
-            <element signature="e#1366#1367#0" expanded="true" />
516
-            <element signature="e#1419#1420#0" expanded="true" />
517
-            <element signature="e#1455#1456#0" expanded="true" />
518
-            <element signature="e#1484#1485#0" expanded="true" />
519
-            <element signature="e#1529#1530#0" expanded="true" />
520
+            <element signature="imports" expanded="true" />
521
+            <element signature="e#282#291#0" expanded="true" />
520
           </folding>
522
           </folding>
521
         </state>
523
         </state>
522
       </provider>
524
       </provider>

+ 19
- 5
src/main/java/MyArrayList.java View File

49
         }
49
         }
50
 
50
 
51
         public boolean isEmpty () {
51
         public boolean isEmpty () {
52
-            return false;
52
+            if (size() > 0) {
53
+                 return false;
54
+            } else
55
+                return true;
53
         }
56
         }
54
 
57
 
55
         public boolean contains (T elementToCheck){
58
         public boolean contains (T elementToCheck){
59
+            for (int i = 0; i < theArray.length; i++) {
60
+                if (theArray[i].equals(elementToCheck)) {
61
+                     return true;
62
+                }
63
+            }
56
             return false;
64
             return false;
57
         }
65
         }
58
 
66
 
59
         public int size() {
67
         public int size() {
60
            return theArray.length;
68
            return theArray.length;
61
         }
69
         }
62
-//
70
+
63
 //        @Override
71
 //        @Override
64
-//        public void add( int index, T elementToAdd){
65
-//
66
-//        }
72
+//        public void add(int index, T elementToAdd) {
73
+//            T [] newArray = (T[]) new Object[theArray.length + 1];
74
+//            for (int i = 0; i < theArray.length; i++) {
75
+//                newArray[i] = theArray[i];
76
+//                if (i == theArray.length-1) {
77
+//                  newArray[i] = elementToAdd;
78
+//                }
79
+//            }
80
+//        } Make a super or abstract class of AbstractList??
67
 
81
 
68
 }
82
 }

+ 62
- 3
src/test/java/MyArrayListTest.java View File

44
     }
44
     }
45
 
45
 
46
     @Test
46
     @Test
47
-    public void clearTest() {
47
+    public void clearStringTest() {
48
         //given
48
         //given
49
         String [] testStringArr = {"I", "am", "making", "some", "progress"};
49
         String [] testStringArr = {"I", "am", "making", "some", "progress"};
50
         MyArrayList<String> myArrayList = new MyArrayList<>(testStringArr);
50
         MyArrayList<String> myArrayList = new MyArrayList<>(testStringArr);
54
         Assert.assertNull(testStringArr[1]);
54
         Assert.assertNull(testStringArr[1]);
55
     }
55
     }
56
 
56
 
57
+
57
     @Test
58
     @Test
58
-    public void isEmptyTest() {
59
+    public void clearIntTest() {
59
         //given
60
         //given
61
+        Integer [] testIntegerArr = {3, 5, 6, 7, 1};
62
+        MyArrayList<Integer> myArrayList = new MyArrayList<>(testIntegerArr);
63
+        //when
64
+        myArrayList.clear();
65
+        //then
66
+        Assert.assertNull(testIntegerArr[1]);
67
+    }
60
 
68
 
69
+    @Test
70
+    public void isEmptyIntegerTest() {
71
+        //given
72
+        Integer [] testIntegerArray = {1, 3, 4};
73
+        MyArrayList<Integer> myArrayList = new MyArrayList<>(testIntegerArray);
61
         //when
74
         //when
75
+        boolean actual = myArrayList.isEmpty();
76
+        //then
77
+        Assert.assertFalse(actual);
78
+    }
62
 
79
 
80
+    @Test
81
+    public void isEmptyBooleanTest() {
82
+        //given
83
+        Boolean [] testBoolsArray = {true, false, false, true};
84
+        MyArrayList<Boolean> myArrayList = new MyArrayList<>(testBoolsArray);
85
+        //when
86
+        boolean actual = myArrayList.isEmpty();
63
         //then
87
         //then
88
+        Assert.assertFalse(actual);
64
     }
89
     }
65
 
90
 
66
     @Test
91
     @Test
67
-    public void containsTest() {
92
+    public void isActuallyEmptyTest() {
68
         //given
93
         //given
94
+        Integer [] testEmptyArray = {};
95
+        MyArrayList<Integer> myArrayList = new MyArrayList<>(testEmptyArray);
96
+        //when
97
+        boolean actual = myArrayList.isEmpty();
98
+        //then
99
+        Assert.assertTrue(actual);
100
+    }
69
 
101
 
102
+
103
+    @Test
104
+    public void containsTrueTest() {
105
+        //given
106
+        Object [] testObjArray = {5, "Pushing", "on", "through", "them", "labs", "BOII", 10};
107
+        MyArrayList<Object> myArrayList = new MyArrayList<>(testObjArray);
70
         //when
108
         //when
109
+        boolean actual = myArrayList.contains("through");
110
+        //then
111
+        Assert.assertTrue(actual);
112
+    }
71
 
113
 
114
+    @Test
115
+    public void containsFalseTest() {
116
+        //given
117
+        Object [] testObjArray = {5, "Pushing", "on", "through", "them", "labs", "BOII", 10};
118
+        MyArrayList<Object> myArrayList = new MyArrayList<>(testObjArray);
119
+        //when
120
+        boolean actual = myArrayList.contains(true);
72
         //then
121
         //then
122
+        Assert.assertFalse(actual);
73
     }
123
     }
74
 
124
 
125
+
75
     @Test
126
     @Test
76
     public void addOverrideTest() {
127
     public void addOverrideTest() {
128
+        //given
129
+        Integer [] testOverrideAddInts = {1, 3, 4, 5};
130
+        MyArrayList<Integer> myArrayList = new MyArrayList<>(testOverrideAddInts);
131
+        //when
132
+        myArrayList.add(1, 2);
133
+        boolean hasBeenAdded = myArrayList.contains(2);
134
+        //then
135
+        Assert.assertTrue(hasBeenAdded);
77
     }
136
     }
78
 }
137
 }