瀏覽代碼

MyArrayList - Complete

Nick Satinover 6 年之前
父節點
當前提交
f6fd7a681c
共有 3 個文件被更改,包括 121 次插入136 次删除
  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 查看文件

@@ -3,7 +3,6 @@
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="6eefb94a-8003-4639-a54f-0d11804b5db5" name="Default Changelist" comment="">
5 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 6
       <change beforePath="$PROJECT_DIR$/src/main/java/MySet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/MySet.java" afterDir="false" />
8 7
       <change beforePath="$PROJECT_DIR$/src/test/java/MySetTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/MySetTest.java" afterDir="false" />
9 8
     </list>
@@ -16,22 +15,22 @@
16 15
   </component>
17 16
   <component name="CoverageDataManager">
18 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 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 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 21
   </component>
23 22
   <component name="CoverageViewManager">
24
-    <option name="myElementSize" value="221" />
23
+    <option name="myElementSize" value="106" />
25 24
   </component>
26 25
   <component name="FUSProjectUsageTrigger">
27 26
     <session id="914426633">
28 27
       <usages-collector id="statistics.lifecycle.project">
29 28
         <counts>
30
-          <entry key="project.closed" value="4" />
29
+          <entry key="project.closed" value="5" />
31 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 32
           <entry key="project.open.time.23" value="1" />
34
-          <entry key="project.opened" value="5" />
33
+          <entry key="project.opened" value="6" />
35 34
         </counts>
36 35
       </usages-collector>
37 36
       <usages-collector id="statistics.file.extensions.open">
@@ -54,43 +53,33 @@
54 53
       </usages-collector>
55 54
       <usages-collector id="statistics.file.extensions.edit">
56 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 58
           <entry key="xml" value="2" />
60 59
         </counts>
61 60
       </usages-collector>
62 61
       <usages-collector id="statistics.file.types.edit">
63 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 65
           <entry key="XML" value="2" />
67 66
         </counts>
68 67
       </usages-collector>
69 68
     </session>
70 69
   </component>
71 70
   <component name="FileEditorManager">
72
-    <splitter split-orientation="horizontal" split-proportion="0.5315024">
71
+    <splitter split-orientation="horizontal" split-proportion="0.3898305">
73 72
       <split-first>
74 73
         <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
75 74
           <file pinned="false" current-in-tab="true">
76 75
             <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
77 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 79
                   <folding>
81 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 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 83
                   </folding>
95 84
                 </state>
96 85
               </provider>
@@ -99,7 +88,7 @@
99 88
           <file pinned="false" current-in-tab="false">
100 89
             <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/Set.java">
101 90
               <provider selected="true" editor-type-id="text-editor">
102
-                <state relative-caret-position="233">
91
+                <state relative-caret-position="1830">
103 92
                   <caret line="145" column="16" selection-start-line="145" selection-start-column="13" selection-end-line="145" selection-end-column="16" />
104 93
                 </state>
105 94
               </provider>
@@ -128,27 +117,13 @@
128 117
           <file pinned="false" current-in-tab="true">
129 118
             <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
130 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 122
                   <folding>
134 123
                     <element signature="imports" expanded="true" />
135
-                    <element signature="e#1474#1480#0" expanded="true" />
136 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 127
                   </folding>
153 128
                 </state>
154 129
               </provider>
@@ -192,8 +167,8 @@
192 167
         <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
193 168
         <option value="$PROJECT_DIR$/pom.xml" />
194 169
         <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
195
-        <option value="$PROJECT_DIR$/src/test/java/MySetTest.java" />
196 170
         <option value="$PROJECT_DIR$/src/main/java/MySet.java" />
171
+        <option value="$PROJECT_DIR$/src/test/java/MySetTest.java" />
197 172
       </list>
198 173
     </option>
199 174
   </component>
@@ -211,9 +186,10 @@
211 186
     </option>
212 187
   </component>
213 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 193
   </component>
218 194
   <component name="ProjectLevelVcsManager" settingsEditedManually="true">
219 195
     <ConfirmationsSetting value="2" id="Add" />
@@ -223,6 +199,7 @@
223 199
       <foldersAlwaysOnTop value="true" />
224 200
     </navigator>
225 201
     <panes>
202
+      <pane id="Scope" />
226 203
       <pane id="ProjectPane">
227 204
         <subPane>
228 205
           <expand>
@@ -266,13 +243,12 @@
266 243
         </subPane>
267 244
       </pane>
268 245
       <pane id="PackagesPane" />
269
-      <pane id="Scope" />
270 246
     </panes>
271 247
   </component>
272 248
   <component name="PropertiesComponent">
273 249
     <property name="WebServerToolWindowFactoryState" value="false" />
274 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 252
     <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
277 253
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
278 254
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
@@ -312,31 +288,31 @@
312 288
         <option name="Make" enabled="true" />
313 289
       </method>
314 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 292
       <module name="generics" />
317 293
       <option name="PACKAGE_NAME" value="" />
318 294
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
319
-      <option name="METHOD_NAME" value="removeStringTest" />
295
+      <option name="METHOD_NAME" value="containAllStringBooleanTest2" />
320 296
       <option name="TEST_OBJECT" value="method" />
321 297
       <method v="2">
322 298
         <option name="Make" enabled="true" />
323 299
       </method>
324 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 302
       <module name="generics" />
327 303
       <option name="PACKAGE_NAME" value="" />
328 304
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
329
-      <option name="METHOD_NAME" value="toArrayObjectTest" />
305
+      <option name="METHOD_NAME" value="retainAllStringBooleanTest1" />
330 306
       <option name="TEST_OBJECT" value="method" />
331 307
       <method v="2">
332 308
         <option name="Make" enabled="true" />
333 309
       </method>
334 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 312
       <module name="generics" />
337 313
       <option name="PACKAGE_NAME" value="" />
338 314
       <option name="MAIN_CLASS_NAME" value="MySetTest" />
339
-      <option name="METHOD_NAME" value="toArrayStringTest" />
315
+      <option name="METHOD_NAME" value="toArrayObjectTest" />
340 316
       <option name="TEST_OBJECT" value="method" />
341 317
       <method v="2">
342 318
         <option name="Make" enabled="true" />
@@ -367,18 +343,18 @@
367 343
     </configuration>
368 344
     <list>
369 345
       <item itemvalue="JUnit.All in generics" />
370
-      <item itemvalue="JUnit.MySetTest.toArrayStringTest" />
371 346
       <item itemvalue="JUnit.MySetTest.toArrayObjectTest" />
372 347
       <item itemvalue="JUnit.MySetTest" />
373
-      <item itemvalue="JUnit.MySetTest.removeStringTest" />
348
+      <item itemvalue="JUnit.MySetTest.retainAllStringBooleanTest1" />
349
+      <item itemvalue="JUnit.MySetTest.containAllStringBooleanTest2" />
374 350
     </list>
375 351
     <recent_temporary>
376 352
       <list>
377 353
         <item itemvalue="JUnit.All in generics" />
354
+        <item itemvalue="JUnit.MySetTest.containAllStringBooleanTest2" />
355
+        <item itemvalue="JUnit.MySetTest.retainAllStringBooleanTest1" />
378 356
         <item itemvalue="JUnit.MySetTest" />
379 357
         <item itemvalue="JUnit.MySetTest.toArrayObjectTest" />
380
-        <item itemvalue="JUnit.MySetTest.removeStringTest" />
381
-        <item itemvalue="JUnit.MySetTest.toArrayStringTest" />
382 358
       </list>
383 359
     </recent_temporary>
384 360
   </component>
@@ -396,7 +372,8 @@
396 372
       <workItem from="1542145228816" duration="418000" />
397 373
       <workItem from="1542165623771" duration="4833000" />
398 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 377
     </task>
401 378
     <task id="LOCAL-00001" summary="MyArrayList&#10;Get, Add">
402 379
       <created>1542167642899</created>
@@ -503,43 +480,50 @@
503 480
       <option name="project" value="LOCAL" />
504 481
       <updated>1542393826034</updated>
505 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 491
     <servers />
508 492
   </component>
509 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 495
       <configuration name="MySetTest" configurationId="JUnit" />
515 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 498
       <configuration name="MySetTest" configurationId="JUnit" />
518 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 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 504
       <configuration name="All in generics" configurationId="JUnit" />
527 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 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 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 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 522
       <configuration name="All in generics" configurationId="JUnit" />
539 523
     </history-entry>
540 524
   </component>
541 525
   <component name="TimeTrackingManager">
542
-    <option name="totallyTimeSpent" value="44695000" />
526
+    <option name="totallyTimeSpent" value="45687000" />
543 527
   </component>
544 528
   <component name="TodoView">
545 529
     <todo-panel id="selected-file">
@@ -551,10 +535,10 @@
551 535
     </todo-panel>
552 536
   </component>
553 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 539
     <editor active="true" />
556 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 542
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
559 543
       <window_info id="Image Layers" order="2" />
560 544
       <window_info id="Designer" order="3" />
@@ -563,7 +547,7 @@
563 547
       <window_info id="Favorites" order="6" side_tool="true" />
564 548
       <window_info anchor="bottom" id="Message" order="0" />
565 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 551
       <window_info anchor="bottom" id="Debug" order="3" sideWeight="0.49757674" weight="0.44145077" />
568 552
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
569 553
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@@ -582,7 +566,7 @@
582 566
       <window_info anchor="right" id="Palette&#9;" order="6" />
583 567
       <window_info anchor="right" id="Database" order="7" />
584 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 570
     </layout>
587 571
   </component>
588 572
   <component name="TypeScriptGeneratedFilesManager">
@@ -603,9 +587,9 @@
603 587
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Working&#10;add, get, contains, remove, addAll, clear, iterator" />
604 588
     <MESSAGE value="MyArrayList - Complete&#10;MySet - Working&#10;add, otherAdd get, contains, remove, addAll, clear, iterator" />
605 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 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 593
   </component>
610 594
   <component name="XDebuggerManager">
611 595
     <watches-manager>
@@ -717,17 +701,17 @@
717 701
         </state>
718 702
       </provider>
719 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 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 708
         </state>
725 709
       </provider>
726 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 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 715
         </state>
732 716
       </provider>
733 717
     </entry>
@@ -745,51 +729,27 @@
745 729
         </state>
746 730
       </provider>
747 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 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 736
           <folding>
753 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 740
           </folding>
772 741
         </state>
773 742
       </provider>
774 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 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 748
           <folding>
780 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 753
           </folding>
794 754
         </state>
795 755
       </provider>

+ 9
- 3
src/main/java/MySet.java 查看文件

@@ -202,9 +202,15 @@ public class MySet<T> extends MyArrayList<T> implements Set<T> {
202 202
 
203 203
     @Override
204 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 查看文件

@@ -149,7 +149,7 @@ public class MySetTest {
149 149
     @Test
150 150
     public void containsAllLongBooleanTest() {
151 151
         // Given
152
-        boolean expected = true;
152
+        boolean expected = false;
153 153
         Long[] inputArray = {1L, 2L, 3L, 4L};
154 154
         ArrayList<Long> addAllArray = new ArrayList<>();
155 155
         addAllArray.add(5L); addAllArray.add(6L); addAllArray.add(7L);  addAllArray.add(1L); addAllArray.add(7L);
@@ -331,17 +331,36 @@ public class MySetTest {
331 331
     }
332 332
 
333 333
     @Test
334
-    public void retainAllStringBooleanTest1() {
334
+    public void containAllStringBooleanTest() {
335 335
         // Given
336
-        boolean expected = false;
336
+        boolean expected = true;
337 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 342
         MySet<String> mySet = new MySet<String>(inputArray);
342 343
 
343 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 365
         // Then
347 366
         Assert.assertEquals(expected, actual);