Sfoglia il codice sorgente

MyArrayList - Complete

Nick Satinover 6 anni fa
parent
commit
f6fd7a681c
3 ha cambiato i file con 121 aggiunte e 136 eliminazioni
  1. 87
    127
      .idea/workspace.xml
  2. 9
    3
      src/main/java/MySet.java
  3. 25
    6
      src/test/java/MySetTest.java

+ 87
- 127
.idea/workspace.xml Vedi File

3
   <component name="ChangeListManager">
3
   <component name="ChangeListManager">
4
     <list default="true" id="6eefb94a-8003-4639-a54f-0d11804b5db5" name="Default Changelist" comment="">
4
     <list default="true" id="6eefb94a-8003-4639-a54f-0d11804b5db5" name="Default Changelist" comment="">
5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
-      <change beforePath="$PROJECT_DIR$/src/main/java/MyArrayList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
7
       <change beforePath="$PROJECT_DIR$/src/main/java/MySet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MySet.java" afterDir="false" />
6
       <change beforePath="$PROJECT_DIR$/src/main/java/MySet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MySet.java" afterDir="false" />
8
       <change beforePath="$PROJECT_DIR$/src/test/java/MySetTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MySetTest.java" afterDir="false" />
7
       <change beforePath="$PROJECT_DIR$/src/test/java/MySetTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MySetTest.java" afterDir="false" />
9
     </list>
8
     </list>
16
   </component>
15
   </component>
17
   <component name="CoverageDataManager">
16
   <component name="CoverageDataManager">
18
     <SUITE FILE_PATH="coverage/generics$MySetTest.ic" NAME="MySetTest Coverage Results" MODIFIED="1542394875742" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
17
     <SUITE FILE_PATH="coverage/generics$MySetTest.ic" NAME="MySetTest Coverage Results" MODIFIED="1542394875742" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
19
-    <SUITE FILE_PATH="coverage/generics$All_in_generics.ic" NAME="All in generics Coverage Results" MODIFIED="1542394916012" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
18
+    <SUITE FILE_PATH="coverage/generics$All_in_generics.ic" NAME="All in generics Coverage Results" MODIFIED="1542397039188" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
20
     <SUITE FILE_PATH="coverage/generics$MyArrayListTest.ic" NAME="MyArrayListTest Coverage Results" MODIFIED="1542228761533" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
19
     <SUITE FILE_PATH="coverage/generics$MyArrayListTest.ic" NAME="MyArrayListTest Coverage Results" MODIFIED="1542228761533" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
21
     <SUITE FILE_PATH="coverage/generics$MySetTest_toArrayStringTest.ic" NAME="MySetTest.toArrayStringTest Coverage Results" MODIFIED="1542391314888" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
20
     <SUITE FILE_PATH="coverage/generics$MySetTest_toArrayStringTest.ic" NAME="MySetTest.toArrayStringTest Coverage Results" MODIFIED="1542391314888" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
22
   </component>
21
   </component>
23
   <component name="CoverageViewManager">
22
   <component name="CoverageViewManager">
24
-    <option name="myElementSize" value="221" />
23
+    <option name="myElementSize" value="106" />
25
   </component>
24
   </component>
26
   <component name="FUSProjectUsageTrigger">
25
   <component name="FUSProjectUsageTrigger">
27
     <session id="914426633">
26
     <session id="914426633">
28
       <usages-collector id="statistics.lifecycle.project">
27
       <usages-collector id="statistics.lifecycle.project">
29
         <counts>
28
         <counts>
30
-          <entry key="project.closed" value="4" />
29
+          <entry key="project.closed" value="5" />
31
           <entry key="project.open.time.0" value="3" />
30
           <entry key="project.open.time.0" value="3" />
32
-          <entry key="project.open.time.2" value="1" />
31
+          <entry key="project.open.time.2" value="2" />
33
           <entry key="project.open.time.23" value="1" />
32
           <entry key="project.open.time.23" value="1" />
34
-          <entry key="project.opened" value="5" />
33
+          <entry key="project.opened" value="6" />
35
         </counts>
34
         </counts>
36
       </usages-collector>
35
       </usages-collector>
37
       <usages-collector id="statistics.file.extensions.open">
36
       <usages-collector id="statistics.file.extensions.open">
54
       </usages-collector>
53
       </usages-collector>
55
       <usages-collector id="statistics.file.extensions.edit">
54
       <usages-collector id="statistics.file.extensions.edit">
56
         <counts>
55
         <counts>
57
-          <entry key="java" value="3600" />
58
-          <entry key="txt" value="168" />
56
+          <entry key="java" value="3656" />
57
+          <entry key="txt" value="176" />
59
           <entry key="xml" value="2" />
58
           <entry key="xml" value="2" />
60
         </counts>
59
         </counts>
61
       </usages-collector>
60
       </usages-collector>
62
       <usages-collector id="statistics.file.types.edit">
61
       <usages-collector id="statistics.file.types.edit">
63
         <counts>
62
         <counts>
64
-          <entry key="JAVA" value="3600" />
65
-          <entry key="PLAIN_TEXT" value="168" />
63
+          <entry key="JAVA" value="3656" />
64
+          <entry key="PLAIN_TEXT" value="176" />
66
           <entry key="XML" value="2" />
65
           <entry key="XML" value="2" />
67
         </counts>
66
         </counts>
68
       </usages-collector>
67
       </usages-collector>
69
     </session>
68
     </session>
70
   </component>
69
   </component>
71
   <component name="FileEditorManager">
70
   <component name="FileEditorManager">
72
-    <splitter split-orientation="horizontal" split-proportion="0.5315024">
71
+    <splitter split-orientation="horizontal" split-proportion="0.3898305">
73
       <split-first>
72
       <split-first>
74
         <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
73
         <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
75
           <file pinned="false" current-in-tab="true">
74
           <file pinned="false" current-in-tab="true">
76
             <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
75
             <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
77
               <provider selected="true" editor-type-id="text-editor">
76
               <provider selected="true" editor-type-id="text-editor">
78
-                <state relative-caret-position="212">
79
-                  <caret line="82" column="11" lean-forward="true" selection-start-line="82" selection-start-column="11" selection-end-line="82" selection-end-column="11" />
77
+                <state relative-caret-position="256">
78
+                  <caret line="201" lean-forward="true" selection-start-line="201" selection-end-line="201" />
80
                   <folding>
79
                   <folding>
81
                     <element signature="imports" expanded="true" />
80
                     <element signature="imports" expanded="true" />
82
-                    <element signature="e#242#243#0" expanded="true" />
83
-                    <element signature="e#286#287#0" expanded="true" />
84
-                    <element signature="e#310#311#0" expanded="true" />
85
-                    <element signature="e#350#351#0" expanded="true" />
86
-                    <element signature="e#1249#1250#0" expanded="true" />
87
-                    <element signature="e#1316#1317#0" expanded="true" />
88
-                    <element signature="e#1369#1370#0" expanded="true" />
89
-                    <element signature="e#1429#1430#0" expanded="true" />
90
                     <element signature="e#1531#1532#0" expanded="true" />
81
                     <element signature="e#1531#1532#0" expanded="true" />
91
-                    <element signature="e#1566#1567#0" expanded="true" />
92
-                    <element signature="e#5170#5171#0" expanded="true" />
93
-                    <element signature="e#5207#5208#0" expanded="true" />
82
+                    <element signature="e#1571#1572#0" expanded="true" />
94
                   </folding>
83
                   </folding>
95
                 </state>
84
                 </state>
96
               </provider>
85
               </provider>
99
           <file pinned="false" current-in-tab="false">
88
           <file pinned="false" current-in-tab="false">
100
             <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/Set.java">
89
             <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/Set.java">
101
               <provider selected="true" editor-type-id="text-editor">
90
               <provider selected="true" editor-type-id="text-editor">
102
-                <state relative-caret-position="233">
91
+                <state relative-caret-position="1830">
103
                   <caret line="145" column="16" selection-start-line="145" selection-start-column="13" selection-end-line="145" selection-end-column="16" />
92
                   <caret line="145" column="16" selection-start-line="145" selection-start-column="13" selection-end-line="145" selection-end-column="16" />
104
                 </state>
93
                 </state>
105
               </provider>
94
               </provider>
128
           <file pinned="false" current-in-tab="true">
117
           <file pinned="false" current-in-tab="true">
129
             <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
118
             <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
130
               <provider selected="true" editor-type-id="text-editor">
119
               <provider selected="true" editor-type-id="text-editor">
131
-                <state relative-caret-position="233">
132
-                  <caret line="80" column="30" selection-start-line="80" selection-start-column="23" selection-end-line="80" selection-end-column="30" />
120
+                <state relative-caret-position="2265">
121
+                  <caret line="151" column="32" selection-start-line="151" selection-start-column="32" selection-end-line="151" selection-end-column="32" />
133
                   <folding>
122
                   <folding>
134
                     <element signature="imports" expanded="true" />
123
                     <element signature="imports" expanded="true" />
135
-                    <element signature="e#1474#1480#0" expanded="true" />
136
                     <element signature="e#1872#1880#0" expanded="true" />
124
                     <element signature="e#1872#1880#0" expanded="true" />
137
-                    <element signature="e#2245#2253#0" expanded="true" />
138
-                    <element signature="e#2653#2661#0" expanded="true" />
139
-                    <element signature="e#3036#3044#0" expanded="true" />
140
-                    <element signature="e#3616#3622#0" expanded="true" />
141
-                    <element signature="e#4158#4164#0" expanded="true" />
142
-                    <element signature="e#4812#4820#0" expanded="true" />
143
-                    <element signature="e#5255#5263#0" expanded="true" />
144
-                    <element signature="e#5704#5712#0" expanded="true" />
145
-                    <element signature="e#6242#6248#0" expanded="true" />
146
-                    <element signature="e#6630#6636#0" expanded="true" />
147
-                    <element signature="e#7104#7110#0" expanded="true" />
148
-                    <element signature="e#7595#7601#0" expanded="true" />
149
-                    <element signature="e#8079#8087#0" expanded="true" />
150
-                    <element signature="e#8588#8596#0" expanded="true" />
151
-                    <element signature="e#9077#9085#0" expanded="true" />
125
+                    <element signature="e#9076#9084#0" expanded="true" />
126
+                    <element signature="e#9579#9587#0" expanded="true" />
152
                   </folding>
127
                   </folding>
153
                 </state>
128
                 </state>
154
               </provider>
129
               </provider>
192
         <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
167
         <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
193
         <option value="$PROJECT_DIR$/pom.xml" />
168
         <option value="$PROJECT_DIR$/pom.xml" />
194
         <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
169
         <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
195
-        <option value="$PROJECT_DIR$/src/test/java/MySetTest.java" />
196
         <option value="$PROJECT_DIR$/src/main/java/MySet.java" />
170
         <option value="$PROJECT_DIR$/src/main/java/MySet.java" />
171
+        <option value="$PROJECT_DIR$/src/test/java/MySetTest.java" />
197
       </list>
172
       </list>
198
     </option>
173
     </option>
199
   </component>
174
   </component>
211
     </option>
186
     </option>
212
   </component>
187
   </component>
213
   <component name="ProjectFrameBounds" extendedState="6">
188
   <component name="ProjectFrameBounds" extendedState="6">
214
-    <option name="y" value="23" />
215
-    <option name="width" value="1280" />
216
-    <option name="height" value="709" />
189
+    <option name="x" value="-309" />
190
+    <option name="y" value="-1057" />
191
+    <option name="width" value="1920" />
192
+    <option name="height" value="1057" />
217
   </component>
193
   </component>
218
   <component name="ProjectLevelVcsManager" settingsEditedManually="true">
194
   <component name="ProjectLevelVcsManager" settingsEditedManually="true">
219
     <ConfirmationsSetting value="2" id="Add" />
195
     <ConfirmationsSetting value="2" id="Add" />
223
       <foldersAlwaysOnTop value="true" />
199
       <foldersAlwaysOnTop value="true" />
224
     </navigator>
200
     </navigator>
225
     <panes>
201
     <panes>
202
+      <pane id="Scope" />
226
       <pane id="ProjectPane">
203
       <pane id="ProjectPane">
227
         <subPane>
204
         <subPane>
228
           <expand>
205
           <expand>
266
         </subPane>
243
         </subPane>
267
       </pane>
244
       </pane>
268
       <pane id="PackagesPane" />
245
       <pane id="PackagesPane" />
269
-      <pane id="Scope" />
270
     </panes>
246
     </panes>
271
   </component>
247
   </component>
272
   <component name="PropertiesComponent">
248
   <component name="PropertiesComponent">
273
     <property name="WebServerToolWindowFactoryState" value="false" />
249
     <property name="WebServerToolWindowFactoryState" value="false" />
274
     <property name="aspect.path.notification.shown" value="true" />
250
     <property name="aspect.path.notification.shown" value="true" />
275
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542395059432" />
251
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542397048904" />
276
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
252
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
277
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
253
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
278
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
254
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
312
         <option name="Make" enabled="true" />
288
         <option name="Make" enabled="true" />
313
       </method>
289
       </method>
314
     </configuration>
290
     </configuration>
315
-    <configuration name="MySetTest.removeStringTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
291
+    <configuration name="MySetTest.containAllStringBooleanTest2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
316
       <module name="generics" />
292
       <module name="generics" />
317
       <option name="PACKAGE_NAME" value="" />
293
       <option name="PACKAGE_NAME" value="" />
318
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
294
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
319
-      <option name="METHOD_NAME" value="removeStringTest" />
295
+      <option name="METHOD_NAME" value="containAllStringBooleanTest2" />
320
       <option name="TEST_OBJECT" value="method" />
296
       <option name="TEST_OBJECT" value="method" />
321
       <method v="2">
297
       <method v="2">
322
         <option name="Make" enabled="true" />
298
         <option name="Make" enabled="true" />
323
       </method>
299
       </method>
324
     </configuration>
300
     </configuration>
325
-    <configuration name="MySetTest.toArrayObjectTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
301
+    <configuration name="MySetTest.retainAllStringBooleanTest1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
326
       <module name="generics" />
302
       <module name="generics" />
327
       <option name="PACKAGE_NAME" value="" />
303
       <option name="PACKAGE_NAME" value="" />
328
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
304
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
329
-      <option name="METHOD_NAME" value="toArrayObjectTest" />
305
+      <option name="METHOD_NAME" value="retainAllStringBooleanTest1" />
330
       <option name="TEST_OBJECT" value="method" />
306
       <option name="TEST_OBJECT" value="method" />
331
       <method v="2">
307
       <method v="2">
332
         <option name="Make" enabled="true" />
308
         <option name="Make" enabled="true" />
333
       </method>
309
       </method>
334
     </configuration>
310
     </configuration>
335
-    <configuration name="MySetTest.toArrayStringTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
311
+    <configuration name="MySetTest.toArrayObjectTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
336
       <module name="generics" />
312
       <module name="generics" />
337
       <option name="PACKAGE_NAME" value="" />
313
       <option name="PACKAGE_NAME" value="" />
338
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
314
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
339
-      <option name="METHOD_NAME" value="toArrayStringTest" />
315
+      <option name="METHOD_NAME" value="toArrayObjectTest" />
340
       <option name="TEST_OBJECT" value="method" />
316
       <option name="TEST_OBJECT" value="method" />
341
       <method v="2">
317
       <method v="2">
342
         <option name="Make" enabled="true" />
318
         <option name="Make" enabled="true" />
367
     </configuration>
343
     </configuration>
368
     <list>
344
     <list>
369
       <item itemvalue="JUnit.All in generics" />
345
       <item itemvalue="JUnit.All in generics" />
370
-      <item itemvalue="JUnit.MySetTest.toArrayStringTest" />
371
       <item itemvalue="JUnit.MySetTest.toArrayObjectTest" />
346
       <item itemvalue="JUnit.MySetTest.toArrayObjectTest" />
372
       <item itemvalue="JUnit.MySetTest" />
347
       <item itemvalue="JUnit.MySetTest" />
373
-      <item itemvalue="JUnit.MySetTest.removeStringTest" />
348
+      <item itemvalue="JUnit.MySetTest.retainAllStringBooleanTest1" />
349
+      <item itemvalue="JUnit.MySetTest.containAllStringBooleanTest2" />
374
     </list>
350
     </list>
375
     <recent_temporary>
351
     <recent_temporary>
376
       <list>
352
       <list>
377
         <item itemvalue="JUnit.All in generics" />
353
         <item itemvalue="JUnit.All in generics" />
354
+        <item itemvalue="JUnit.MySetTest.containAllStringBooleanTest2" />
355
+        <item itemvalue="JUnit.MySetTest.retainAllStringBooleanTest1" />
378
         <item itemvalue="JUnit.MySetTest" />
356
         <item itemvalue="JUnit.MySetTest" />
379
         <item itemvalue="JUnit.MySetTest.toArrayObjectTest" />
357
         <item itemvalue="JUnit.MySetTest.toArrayObjectTest" />
380
-        <item itemvalue="JUnit.MySetTest.removeStringTest" />
381
-        <item itemvalue="JUnit.MySetTest.toArrayStringTest" />
382
       </list>
358
       </list>
383
     </recent_temporary>
359
     </recent_temporary>
384
   </component>
360
   </component>
396
       <workItem from="1542145228816" duration="418000" />
372
       <workItem from="1542145228816" duration="418000" />
397
       <workItem from="1542165623771" duration="4833000" />
373
       <workItem from="1542165623771" duration="4833000" />
398
       <workItem from="1542225031291" duration="12159000" />
374
       <workItem from="1542225031291" duration="12159000" />
399
-      <workItem from="1542293882069" duration="27205000" />
375
+      <workItem from="1542293882069" duration="27243000" />
376
+      <workItem from="1542396231078" duration="954000" />
400
     </task>
377
     </task>
401
     <task id="LOCAL-00001" summary="MyArrayList&#10;Get, Add">
378
     <task id="LOCAL-00001" summary="MyArrayList&#10;Get, Add">
402
       <created>1542167642899</created>
379
       <created>1542167642899</created>
503
       <option name="project" value="LOCAL" />
480
       <option name="project" value="LOCAL" />
504
       <updated>1542393826034</updated>
481
       <updated>1542393826034</updated>
505
     </task>
482
     </task>
506
-    <option name="localTasksCounter" value="16" />
483
+    <task id="LOCAL-00016" summary="MyArrayList - Complete&#10;MySet - Complete">
484
+      <created>1542395223397</created>
485
+      <option name="number" value="00016" />
486
+      <option name="presentableId" value="LOCAL-00016" />
487
+      <option name="project" value="LOCAL" />
488
+      <updated>1542395223397</updated>
489
+    </task>
490
+    <option name="localTasksCounter" value="17" />
507
     <servers />
491
     <servers />
508
   </component>
492
   </component>
509
   <component name="TestHistory">
493
   <component name="TestHistory">
510
-    <history-entry file="MySetTest_toArrayObjectTest - 2018.11.16 at 13h 47m 25s.xml">
511
-      <configuration name="MySetTest.toArrayObjectTest" configurationId="JUnit" />
512
-    </history-entry>
513
-    <history-entry file="MySetTest - 2018.11.16 at 13h 50m 07s.xml">
494
+    <history-entry file="MySetTest - 2018.11.16 at 14h 00m 39s.xml">
514
       <configuration name="MySetTest" configurationId="JUnit" />
495
       <configuration name="MySetTest" configurationId="JUnit" />
515
     </history-entry>
496
     </history-entry>
516
-    <history-entry file="MySetTest - 2018.11.16 at 13h 57m 43s.xml">
497
+    <history-entry file="MySetTest - 2018.11.16 at 14h 01m 18s.xml">
517
       <configuration name="MySetTest" configurationId="JUnit" />
498
       <configuration name="MySetTest" configurationId="JUnit" />
518
     </history-entry>
499
     </history-entry>
519
-    <history-entry file="MySetTest_toArrayObjectTest - 2018.11.16 at 13h 58m 46s.xml">
520
-      <configuration name="MySetTest.toArrayObjectTest" configurationId="JUnit" />
521
-    </history-entry>
522
-    <history-entry file="MySetTest - 2018.11.16 at 13h 58m 53s.xml">
523
-      <configuration name="MySetTest" configurationId="JUnit" />
500
+    <history-entry file="All_in_generics - 2018.11.16 at 14h 01m 58s.xml">
501
+      <configuration name="All in generics" configurationId="JUnit" />
524
     </history-entry>
502
     </history-entry>
525
-    <history-entry file="All_in_generics - 2018.11.16 at 13h 59m 04s.xml">
503
+    <history-entry file="All_in_generics - 2018.11.16 at 14h 24m 12s.xml">
526
       <configuration name="All in generics" configurationId="JUnit" />
504
       <configuration name="All in generics" configurationId="JUnit" />
527
     </history-entry>
505
     </history-entry>
528
-    <history-entry file="MySetTest_toArrayObjectTest - 2018.11.16 at 14h 00m 27s.xml">
529
-      <configuration name="MySetTest.toArrayObjectTest" configurationId="JUnit" />
506
+    <history-entry file="MySetTest_retainAllStringBooleanTest1 - 2018.11.16 at 14h 34m 19s.xml">
507
+      <configuration name="MySetTest.retainAllStringBooleanTest1" configurationId="JUnit" />
530
     </history-entry>
508
     </history-entry>
531
-    <history-entry file="MySetTest - 2018.11.16 at 14h 00m 39s.xml">
532
-      <configuration name="MySetTest" configurationId="JUnit" />
509
+    <history-entry file="MySetTest_retainAllStringBooleanTest1 - 2018.11.16 at 14h 34m 34s.xml">
510
+      <configuration name="MySetTest.retainAllStringBooleanTest1" configurationId="JUnit" />
533
     </history-entry>
511
     </history-entry>
534
-    <history-entry file="MySetTest - 2018.11.16 at 14h 01m 18s.xml">
535
-      <configuration name="MySetTest" configurationId="JUnit" />
512
+    <history-entry file="MySetTest_containAllStringBooleanTest2 - 2018.11.16 at 14h 35m 50s.xml">
513
+      <configuration name="MySetTest.containAllStringBooleanTest2" configurationId="JUnit" />
536
     </history-entry>
514
     </history-entry>
537
-    <history-entry file="All_in_generics - 2018.11.16 at 14h 01m 58s.xml">
515
+    <history-entry file="MySetTest_containAllStringBooleanTest2 - 2018.11.16 at 14h 36m 00s.xml">
516
+      <configuration name="MySetTest.containAllStringBooleanTest2" configurationId="JUnit" />
517
+    </history-entry>
518
+    <history-entry file="All_in_generics - 2018.11.16 at 14h 36m 16s.xml">
519
+      <configuration name="All in generics" configurationId="JUnit" />
520
+    </history-entry>
521
+    <history-entry file="All_in_generics - 2018.11.16 at 14h 37m 21s.xml">
538
       <configuration name="All in generics" configurationId="JUnit" />
522
       <configuration name="All in generics" configurationId="JUnit" />
539
     </history-entry>
523
     </history-entry>
540
   </component>
524
   </component>
541
   <component name="TimeTrackingManager">
525
   <component name="TimeTrackingManager">
542
-    <option name="totallyTimeSpent" value="44695000" />
526
+    <option name="totallyTimeSpent" value="45687000" />
543
   </component>
527
   </component>
544
   <component name="TodoView">
528
   <component name="TodoView">
545
     <todo-panel id="selected-file">
529
     <todo-panel id="selected-file">
551
     </todo-panel>
535
     </todo-panel>
552
   </component>
536
   </component>
553
   <component name="ToolWindowManager">
537
   <component name="ToolWindowManager">
554
-    <frame x="0" y="23" width="1280" height="709" extended-state="6" />
538
+    <frame x="-309" y="-1057" width="1920" height="1057" extended-state="6" />
555
     <editor active="true" />
539
     <editor active="true" />
556
     <layout>
540
     <layout>
557
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26171243" />
541
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.15015975" />
558
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
542
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
559
       <window_info id="Image Layers" order="2" />
543
       <window_info id="Image Layers" order="2" />
560
       <window_info id="Designer" order="3" />
544
       <window_info id="Designer" order="3" />
563
       <window_info id="Favorites" order="6" side_tool="true" />
547
       <window_info id="Favorites" order="6" side_tool="true" />
564
       <window_info anchor="bottom" id="Message" order="0" />
548
       <window_info anchor="bottom" id="Message" order="0" />
565
       <window_info anchor="bottom" id="Find" order="1" weight="0.32953367" />
549
       <window_info anchor="bottom" id="Find" order="1" weight="0.32953367" />
566
-      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.4983845" visible="true" weight="0.28363046" />
550
+      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.4983845" visible="true" weight="0.34507772" />
567
       <window_info anchor="bottom" id="Debug" order="3" sideWeight="0.49757674" weight="0.44145077" />
551
       <window_info anchor="bottom" id="Debug" order="3" sideWeight="0.49757674" weight="0.44145077" />
568
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
552
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
569
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
553
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
582
       <window_info anchor="right" id="Palette&#9;" order="6" />
566
       <window_info anchor="right" id="Palette&#9;" order="6" />
583
       <window_info anchor="right" id="Database" order="7" />
567
       <window_info anchor="right" id="Database" order="7" />
584
       <window_info anchor="right" id="Maven Projects" order="8" />
568
       <window_info anchor="right" id="Maven Projects" order="8" />
585
-      <window_info anchor="right" id="Coverage" order="9" side_tool="true" weight="0.24920128" />
569
+      <window_info active="true" anchor="right" id="Coverage" order="9" side_tool="true" visible="true" weight="0.1400426" />
586
     </layout>
570
     </layout>
587
   </component>
571
   </component>
588
   <component name="TypeScriptGeneratedFilesManager">
572
   <component name="TypeScriptGeneratedFilesManager">
603
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Working&#10;add, get, contains, remove, addAll, clear, iterator" />
587
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Working&#10;add, get, contains, remove, addAll, clear, iterator" />
604
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Working&#10;add, otherAdd get, contains, remove, addAll, clear, iterator" />
588
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Working&#10;add, otherAdd get, contains, remove, addAll, clear, iterator" />
605
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Working&#10;add, otherAdd get, contains, remove, addAll, clear, iterator, removeAll" />
589
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Working&#10;add, otherAdd get, contains, remove, addAll, clear, iterator, removeAll" />
606
-    <MESSAGE value="MyArrayList - Complete&#10;MySet - Complete" />
607
     <MESSAGE value="MyArrayList - Complete&#10;MySet - working set&#10;Changing name to array" />
590
     <MESSAGE value="MyArrayList - Complete&#10;MySet - working set&#10;Changing name to array" />
608
-    <option name="LAST_COMMIT_MESSAGE" value="MyArrayList - Complete&#10;MySet - working set&#10;Changing name to array" />
591
+    <MESSAGE value="MyArrayList - Complete&#10;MySet - Complete" />
592
+    <option name="LAST_COMMIT_MESSAGE" value="MyArrayList - Complete&#10;MySet - Complete" />
609
   </component>
593
   </component>
610
   <component name="XDebuggerManager">
594
   <component name="XDebuggerManager">
611
     <watches-manager>
595
     <watches-manager>
717
         </state>
701
         </state>
718
       </provider>
702
       </provider>
719
     </entry>
703
     </entry>
720
-    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/Set.java">
704
+    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/org/junit/internal/runners/model/ReflectiveCallable.class">
721
       <provider selected="true" editor-type-id="text-editor">
705
       <provider selected="true" editor-type-id="text-editor">
722
-        <state relative-caret-position="233">
723
-          <caret line="145" column="16" selection-start-line="145" selection-start-column="13" selection-end-line="145" selection-end-column="16" />
706
+        <state relative-caret-position="195">
707
+          <caret line="16" selection-start-line="16" selection-end-line="16" />
724
         </state>
708
         </state>
725
       </provider>
709
       </provider>
726
     </entry>
710
     </entry>
727
-    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/org/junit/internal/runners/model/ReflectiveCallable.class">
711
+    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/Set.java">
728
       <provider selected="true" editor-type-id="text-editor">
712
       <provider selected="true" editor-type-id="text-editor">
729
-        <state relative-caret-position="195">
730
-          <caret line="16" selection-start-line="16" selection-end-line="16" />
713
+        <state relative-caret-position="1830">
714
+          <caret line="145" column="16" selection-start-line="145" selection-start-column="13" selection-end-line="145" selection-end-column="16" />
731
         </state>
715
         </state>
732
       </provider>
716
       </provider>
733
     </entry>
717
     </entry>
745
         </state>
729
         </state>
746
       </provider>
730
       </provider>
747
     </entry>
731
     </entry>
748
-    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
732
+    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
749
       <provider selected="true" editor-type-id="text-editor">
733
       <provider selected="true" editor-type-id="text-editor">
750
-        <state relative-caret-position="233">
751
-          <caret line="80" column="30" selection-start-line="80" selection-start-column="23" selection-end-line="80" selection-end-column="30" />
734
+        <state relative-caret-position="256">
735
+          <caret line="201" lean-forward="true" selection-start-line="201" selection-end-line="201" />
752
           <folding>
736
           <folding>
753
             <element signature="imports" expanded="true" />
737
             <element signature="imports" expanded="true" />
754
-            <element signature="e#1474#1480#0" expanded="true" />
755
-            <element signature="e#1872#1880#0" expanded="true" />
756
-            <element signature="e#2245#2253#0" expanded="true" />
757
-            <element signature="e#2653#2661#0" expanded="true" />
758
-            <element signature="e#3036#3044#0" expanded="true" />
759
-            <element signature="e#3616#3622#0" expanded="true" />
760
-            <element signature="e#4158#4164#0" expanded="true" />
761
-            <element signature="e#4812#4820#0" expanded="true" />
762
-            <element signature="e#5255#5263#0" expanded="true" />
763
-            <element signature="e#5704#5712#0" expanded="true" />
764
-            <element signature="e#6242#6248#0" expanded="true" />
765
-            <element signature="e#6630#6636#0" expanded="true" />
766
-            <element signature="e#7104#7110#0" expanded="true" />
767
-            <element signature="e#7595#7601#0" expanded="true" />
768
-            <element signature="e#8079#8087#0" expanded="true" />
769
-            <element signature="e#8588#8596#0" expanded="true" />
770
-            <element signature="e#9077#9085#0" expanded="true" />
738
+            <element signature="e#1531#1532#0" expanded="true" />
739
+            <element signature="e#1571#1572#0" expanded="true" />
771
           </folding>
740
           </folding>
772
         </state>
741
         </state>
773
       </provider>
742
       </provider>
774
     </entry>
743
     </entry>
775
-    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
744
+    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
776
       <provider selected="true" editor-type-id="text-editor">
745
       <provider selected="true" editor-type-id="text-editor">
777
-        <state relative-caret-position="212">
778
-          <caret line="82" column="11" lean-forward="true" selection-start-line="82" selection-start-column="11" selection-end-line="82" selection-end-column="11" />
746
+        <state relative-caret-position="2265">
747
+          <caret line="151" column="32" selection-start-line="151" selection-start-column="32" selection-end-line="151" selection-end-column="32" />
779
           <folding>
748
           <folding>
780
             <element signature="imports" expanded="true" />
749
             <element signature="imports" expanded="true" />
781
-            <element signature="e#242#243#0" expanded="true" />
782
-            <element signature="e#286#287#0" expanded="true" />
783
-            <element signature="e#310#311#0" expanded="true" />
784
-            <element signature="e#350#351#0" expanded="true" />
785
-            <element signature="e#1249#1250#0" expanded="true" />
786
-            <element signature="e#1316#1317#0" expanded="true" />
787
-            <element signature="e#1369#1370#0" expanded="true" />
788
-            <element signature="e#1429#1430#0" expanded="true" />
789
-            <element signature="e#1531#1532#0" expanded="true" />
790
-            <element signature="e#1566#1567#0" expanded="true" />
791
-            <element signature="e#5170#5171#0" expanded="true" />
792
-            <element signature="e#5207#5208#0" expanded="true" />
750
+            <element signature="e#1872#1880#0" expanded="true" />
751
+            <element signature="e#9076#9084#0" expanded="true" />
752
+            <element signature="e#9579#9587#0" expanded="true" />
793
           </folding>
753
           </folding>
794
         </state>
754
         </state>
795
       </provider>
755
       </provider>

+ 9
- 3
src/main/java/MySet.java Vedi File

202
 
202
 
203
     @Override
203
     @Override
204
     public boolean containsAll(Collection c) {
204
     public boolean containsAll(Collection c) {
205
-        return this.addAll(c);
206
-    }
207
-
205
+        boolean returnValue = true;
208
 
206
 
207
+        for (Object elem: c) {
208
+            if (!this.contains(elem)){
209
+                returnValue = false;
210
+                break;
211
+            }
212
+        }
213
+        return returnValue;
214
+    }
209
 
215
 
210
 }
216
 }

+ 25
- 6
src/test/java/MySetTest.java Vedi File

149
     @Test
149
     @Test
150
     public void containsAllLongBooleanTest() {
150
     public void containsAllLongBooleanTest() {
151
         // Given
151
         // Given
152
-        boolean expected = true;
152
+        boolean expected = false;
153
         Long[] inputArray = {1L, 2L, 3L, 4L};
153
         Long[] inputArray = {1L, 2L, 3L, 4L};
154
         ArrayList<Long> addAllArray = new ArrayList<>();
154
         ArrayList<Long> addAllArray = new ArrayList<>();
155
         addAllArray.add(5L); addAllArray.add(6L); addAllArray.add(7L);  addAllArray.add(1L); addAllArray.add(7L);
155
         addAllArray.add(5L); addAllArray.add(6L); addAllArray.add(7L);  addAllArray.add(1L); addAllArray.add(7L);
331
     }
331
     }
332
 
332
 
333
     @Test
333
     @Test
334
-    public void retainAllStringBooleanTest1() {
334
+    public void containAllStringBooleanTest() {
335
         // Given
335
         // Given
336
-        boolean expected = false;
336
+        boolean expected = true;
337
         String[] inputArray = {"a", "2", "3", "4"};
337
         String[] inputArray = {"a", "2", "3", "4"};
338
-        ArrayList<String> retainAllArray = new ArrayList<>();
339
-        retainAllArray.add("5"); retainAllArray.add("b");
338
+
339
+        ArrayList<String> containAllArray = new ArrayList<>();
340
+        containAllArray.add("2"); containAllArray.add("4");
340
 
341
 
341
         MySet<String> mySet = new MySet<String>(inputArray);
342
         MySet<String> mySet = new MySet<String>(inputArray);
342
 
343
 
343
         // When
344
         // When
344
-        boolean actual = mySet.retainAll(retainAllArray);
345
+        boolean actual = mySet.containsAll(containAllArray);
346
+
347
+        // Then
348
+        Assert.assertEquals(expected, actual);
349
+    }
350
+
351
+    @Test
352
+    public void containAllStringBooleanTest2() {
353
+        // Given
354
+        boolean expected = false;
355
+        String[] inputArray = {"4"};
356
+
357
+        ArrayList<String> containAllArray = new ArrayList<>();
358
+        containAllArray.add("2"); containAllArray.add("4");
359
+
360
+        MySet<String> mySet = new MySet<String>(inputArray);
361
+
362
+        // When
363
+        boolean actual = mySet.containsAll(containAllArray);
345
 
364
 
346
         // Then
365
         // Then
347
         Assert.assertEquals(expected, actual);
366
         Assert.assertEquals(expected, actual);