#27 MyArrayList!

開啟中
WMartinez44 請求將 2 次程式碼提交從 WMartinez44/CR-MicroLabs-Generics-MyArrayList:master 合併至 master

+ 1
- 0
.idea/.name 查看文件

@@ -0,0 +1 @@
1
+generics

+ 16
- 0
.idea/compiler.xml 查看文件

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="CompilerConfiguration">
4
+    <annotationProcessing>
5
+      <profile name="Maven default annotation processors profile" enabled="true">
6
+        <sourceOutputDir name="target/generated-sources/annotations" />
7
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
+        <outputRelativeToContentRoot value="true" />
9
+        <module name="generics" />
10
+      </profile>
11
+    </annotationProcessing>
12
+    <bytecodeTargetLevel>
13
+      <module name="generics" target="1.7" />
14
+    </bytecodeTargetLevel>
15
+  </component>
16
+</project>

+ 13
- 0
.idea/libraries/Maven__junit_junit_4_12.xml 查看文件

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: junit:junit:4.12">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml 查看文件

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: org.hamcrest:hamcrest-core:1.3">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
.idea/misc.xml 查看文件

@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="MavenProjectsManager">
4
+    <option name="originalFiles">
5
+      <list>
6
+        <option value="$PROJECT_DIR$/pom.xml" />
7
+      </list>
8
+    </option>
9
+  </component>
10
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
11
+    <output url="file://$PROJECT_DIR$/classes" />
12
+  </component>
13
+</project>

+ 8
- 0
.idea/modules.xml 查看文件

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/generics.iml" filepath="$PROJECT_DIR$/generics.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
.idea/vcs.xml 查看文件

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+  </component>
6
+</project>

+ 606
- 0
.idea/workspace.xml 查看文件

@@ -0,0 +1,606 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="539f264b-d418-4926-97c2-22e9339fa550" name="Default Changelist" comment="">
5
+      <change beforePath="$PROJECT_DIR$/src/main/java/ArrayList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ArrayList.java" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/src/main/java/Arraylists.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Arraylists.java" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/src/main/java/Set.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Set.java" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/src/test/java/ArrayListTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/ArrayListTest.java" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/src/test/java/ArraysTest2list.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/ArraysTest2list.java" afterDir="false" />
10
+      <change beforePath="$PROJECT_DIR$/src/test/java/SetTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/SetTest.java" afterDir="false" />
11
+    </list>
12
+    <ignored path="$PROJECT_DIR$/target/" />
13
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
14
+    <option name="SHOW_DIALOG" value="false" />
15
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
16
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
17
+    <option name="LAST_RESOLUTION" value="IGNORE" />
18
+  </component>
19
+  <component name="CoverageDataManager">
20
+    <SUITE FILE_PATH="coverage/generics$SetTest_removeTest.ic" NAME="SetTest.removeTest Coverage Results" MODIFIED="1542815198155" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
21
+    <SUITE FILE_PATH="coverage/generics$ArrayListTest.ic" NAME="ArrayListTest Coverage Results" MODIFIED="1542675514822" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
22
+    <SUITE FILE_PATH="coverage/generics$SetTest_sizetest.ic" NAME="SetTest.sizetest Coverage Results" MODIFIED="1542684952691" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
23
+    <SUITE FILE_PATH="coverage/generics$All_in_generics.ic" NAME="All in generics Coverage Results" MODIFIED="1542815211698" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
24
+  </component>
25
+  <component name="CoverageViewManager">
26
+    <option name="myElementSize" value="59" />
27
+  </component>
28
+  <component name="FUSProjectUsageTrigger">
29
+    <session id="-664781145">
30
+      <usages-collector id="statistics.lifecycle.project">
31
+        <counts>
32
+          <entry key="project.open.time.0" value="1" />
33
+          <entry key="project.opened" value="1" />
34
+        </counts>
35
+      </usages-collector>
36
+      <usages-collector id="statistics.file.extensions.open">
37
+        <counts>
38
+          <entry key="java" value="23" />
39
+        </counts>
40
+      </usages-collector>
41
+      <usages-collector id="statistics.file.types.open">
42
+        <counts>
43
+          <entry key="JAVA" value="23" />
44
+        </counts>
45
+      </usages-collector>
46
+      <usages-collector id="statistics.file.extensions.edit">
47
+        <counts>
48
+          <entry key="java" value="6561" />
49
+        </counts>
50
+      </usages-collector>
51
+      <usages-collector id="statistics.file.types.edit">
52
+        <counts>
53
+          <entry key="JAVA" value="6561" />
54
+        </counts>
55
+      </usages-collector>
56
+    </session>
57
+  </component>
58
+  <component name="FileEditorManager">
59
+    <leaf>
60
+      <file pinned="false" current-in-tab="false">
61
+        <entry file="file://$PROJECT_DIR$/src/test/java/ArrayListTest.java">
62
+          <provider selected="true" editor-type-id="text-editor">
63
+            <state relative-caret-position="-1364">
64
+              <caret line="70" column="34" selection-start-line="70" selection-start-column="34" selection-end-line="70" selection-end-column="34" />
65
+              <folding>
66
+                <element signature="imports" expanded="true" />
67
+              </folding>
68
+            </state>
69
+          </provider>
70
+        </entry>
71
+      </file>
72
+      <file pinned="false" current-in-tab="true">
73
+        <entry file="file://$PROJECT_DIR$/src/main/java/ArrayList.java">
74
+          <provider selected="true" editor-type-id="text-editor">
75
+            <state relative-caret-position="113">
76
+              <caret line="73" column="24" selection-start-line="73" selection-start-column="24" selection-end-line="73" selection-end-column="24" />
77
+              <folding>
78
+                <element signature="e#300#330#0" expanded="true" />
79
+                <element signature="e#525#555#0" expanded="true" />
80
+              </folding>
81
+            </state>
82
+          </provider>
83
+        </entry>
84
+      </file>
85
+      <file pinned="false" current-in-tab="false">
86
+        <entry file="file://$PROJECT_DIR$/src/main/java/Set.java">
87
+          <provider selected="true" editor-type-id="text-editor">
88
+            <state relative-caret-position="90">
89
+              <caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
90
+              <folding>
91
+                <element signature="imports" expanded="true" />
92
+                <element signature="e#62#63#0" expanded="true" />
93
+                <element signature="e#100#101#0" expanded="true" />
94
+                <element signature="e#294#295#0" expanded="true" />
95
+                <element signature="e#317#318#0" expanded="true" />
96
+              </folding>
97
+            </state>
98
+          </provider>
99
+        </entry>
100
+      </file>
101
+      <file pinned="false" current-in-tab="false">
102
+        <entry file="file://$PROJECT_DIR$/src/main/java/Maps.java">
103
+          <provider selected="true" editor-type-id="text-editor">
104
+            <state>
105
+              <caret column="17" selection-start-column="17" selection-end-column="17" />
106
+            </state>
107
+          </provider>
108
+        </entry>
109
+      </file>
110
+      <file pinned="false" current-in-tab="false">
111
+        <entry file="file://$PROJECT_DIR$/src/test/java/SetTest.java">
112
+          <provider selected="true" editor-type-id="text-editor">
113
+            <state relative-caret-position="776">
114
+              <caret line="59" column="28" lean-forward="true" selection-start-line="59" selection-start-column="28" selection-end-line="59" selection-end-column="28" />
115
+              <folding>
116
+                <element signature="imports" expanded="true" />
117
+              </folding>
118
+            </state>
119
+          </provider>
120
+        </entry>
121
+      </file>
122
+    </leaf>
123
+  </component>
124
+  <component name="FileTemplateManagerImpl">
125
+    <option name="RECENT_TEMPLATES">
126
+      <list>
127
+        <option value="Class" />
128
+      </list>
129
+    </option>
130
+  </component>
131
+  <component name="FindInProjectRecents">
132
+    <findStrings>
133
+      <find>clear</find>
134
+    </findStrings>
135
+    <replaceStrings>
136
+      <replace />
137
+    </replaceStrings>
138
+    <dirStrings>
139
+      <dir>$PROJECT_DIR$/src/test/java</dir>
140
+    </dirStrings>
141
+  </component>
142
+  <component name="Git.Settings">
143
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
144
+  </component>
145
+  <component name="IdeDocumentHistory">
146
+    <option name="CHANGED_PATHS">
147
+      <list>
148
+        <option value="$PROJECT_DIR$/src/main/java/Arraylists.java" />
149
+        <option value="$PROJECT_DIR$/src/test/java/ArraysTest2list.java" />
150
+        <option value="$PROJECT_DIR$/src/test/java/ArrayListTest.java" />
151
+        <option value="$PROJECT_DIR$/src/main/java/Maps.java" />
152
+        <option value="$PROJECT_DIR$/src/main/java/ArrayList.java" />
153
+        <option value="$PROJECT_DIR$/src/main/java/Set.java" />
154
+        <option value="$PROJECT_DIR$/src/test/java/SetTest.java" />
155
+      </list>
156
+    </option>
157
+  </component>
158
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
159
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
160
+  <component name="JsGulpfileManager">
161
+    <detection-done>true</detection-done>
162
+    <sorting>DEFINITION_ORDER</sorting>
163
+  </component>
164
+  <component name="ProjectFrameBounds">
165
+    <option name="x" value="121" />
166
+    <option name="y" value="51" />
167
+    <option name="width" value="951" />
168
+    <option name="height" value="709" />
169
+  </component>
170
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
171
+  <component name="ProjectView">
172
+    <navigator proportions="" version="1">
173
+      <foldersAlwaysOnTop value="true" />
174
+    </navigator>
175
+    <panes>
176
+      <pane id="PackagesPane" />
177
+      <pane id="ProjectPane">
178
+        <subPane>
179
+          <expand>
180
+            <path>
181
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
182
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
183
+            </path>
184
+            <path>
185
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
186
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
187
+              <item name="src" type="462c0819:PsiDirectoryNode" />
188
+            </path>
189
+            <path>
190
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
191
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
192
+              <item name="src" type="462c0819:PsiDirectoryNode" />
193
+              <item name="main" type="462c0819:PsiDirectoryNode" />
194
+            </path>
195
+            <path>
196
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
197
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
198
+              <item name="src" type="462c0819:PsiDirectoryNode" />
199
+              <item name="main" type="462c0819:PsiDirectoryNode" />
200
+              <item name="java" type="462c0819:PsiDirectoryNode" />
201
+            </path>
202
+            <path>
203
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
204
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
205
+              <item name="src" type="462c0819:PsiDirectoryNode" />
206
+              <item name="test" type="462c0819:PsiDirectoryNode" />
207
+            </path>
208
+            <path>
209
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
210
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
211
+              <item name="src" type="462c0819:PsiDirectoryNode" />
212
+              <item name="test" type="462c0819:PsiDirectoryNode" />
213
+              <item name="java" type="462c0819:PsiDirectoryNode" />
214
+            </path>
215
+          </expand>
216
+          <select />
217
+        </subPane>
218
+      </pane>
219
+      <pane id="Scope" />
220
+    </panes>
221
+  </component>
222
+  <component name="PropertiesComponent">
223
+    <property name="WebServerToolWindowFactoryState" value="false" />
224
+    <property name="aspect.path.notification.shown" value="true" />
225
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542815232942" />
226
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
227
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
228
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
229
+    <property name="project.structure.last.edited" value="Modules" />
230
+    <property name="project.structure.proportion" value="0.15" />
231
+    <property name="project.structure.side.proportion" value="0.2" />
232
+  </component>
233
+  <component name="RunDashboard">
234
+    <option name="ruleStates">
235
+      <list>
236
+        <RuleState>
237
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
238
+        </RuleState>
239
+        <RuleState>
240
+          <option name="name" value="StatusDashboardGroupingRule" />
241
+        </RuleState>
242
+      </list>
243
+    </option>
244
+  </component>
245
+  <component name="RunManager" selected="JUnit.All in generics">
246
+    <configuration name="All in generics" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
247
+      <module name="generics" />
248
+      <option name="PACKAGE_NAME" value="" />
249
+      <option name="TEST_OBJECT" value="package" />
250
+      <method v="2">
251
+        <option name="Make" enabled="true" />
252
+      </method>
253
+    </configuration>
254
+    <configuration name="SetTest.add" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
255
+      <module name="generics" />
256
+      <option name="PACKAGE_NAME" value="" />
257
+      <option name="MAIN_CLASS_NAME" value="SetTest" />
258
+      <option name="METHOD_NAME" value="add" />
259
+      <option name="TEST_OBJECT" value="method" />
260
+      <method v="2">
261
+        <option name="Make" enabled="true" />
262
+      </method>
263
+    </configuration>
264
+    <configuration name="SetTest.addDouble" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
265
+      <module name="generics" />
266
+      <option name="PACKAGE_NAME" value="" />
267
+      <option name="MAIN_CLASS_NAME" value="SetTest" />
268
+      <option name="METHOD_NAME" value="addDouble" />
269
+      <option name="TEST_OBJECT" value="method" />
270
+      <method v="2">
271
+        <option name="Make" enabled="true" />
272
+      </method>
273
+    </configuration>
274
+    <configuration name="SetTest.removeTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
275
+      <module name="generics" />
276
+      <option name="PACKAGE_NAME" value="" />
277
+      <option name="MAIN_CLASS_NAME" value="SetTest" />
278
+      <option name="METHOD_NAME" value="removeTest" />
279
+      <option name="TEST_OBJECT" value="method" />
280
+      <method v="2">
281
+        <option name="Make" enabled="true" />
282
+      </method>
283
+    </configuration>
284
+    <configuration name="SetTest.sizetest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
285
+      <module name="generics" />
286
+      <option name="PACKAGE_NAME" value="" />
287
+      <option name="MAIN_CLASS_NAME" value="SetTest" />
288
+      <option name="METHOD_NAME" value="sizetest" />
289
+      <option name="TEST_OBJECT" value="method" />
290
+      <method v="2">
291
+        <option name="Make" enabled="true" />
292
+      </method>
293
+    </configuration>
294
+    <list>
295
+      <item itemvalue="JUnit.All in generics" />
296
+      <item itemvalue="JUnit.SetTest.add" />
297
+      <item itemvalue="JUnit.SetTest.addDouble" />
298
+      <item itemvalue="JUnit.SetTest.sizetest" />
299
+      <item itemvalue="JUnit.SetTest.removeTest" />
300
+    </list>
301
+    <recent_temporary>
302
+      <list>
303
+        <item itemvalue="JUnit.All in generics" />
304
+        <item itemvalue="JUnit.SetTest.removeTest" />
305
+        <item itemvalue="JUnit.SetTest.sizetest" />
306
+        <item itemvalue="JUnit.SetTest.addDouble" />
307
+        <item itemvalue="JUnit.SetTest.add" />
308
+      </list>
309
+    </recent_temporary>
310
+  </component>
311
+  <component name="SvnConfiguration">
312
+    <configuration />
313
+  </component>
314
+  <component name="TaskManager">
315
+    <task active="true" id="Default" summary="Default task">
316
+      <changelist id="539f264b-d418-4926-97c2-22e9339fa550" name="Default Changelist" comment="" />
317
+      <created>1542508306819</created>
318
+      <option name="number" value="Default" />
319
+      <option name="presentableId" value="Default" />
320
+      <updated>1542508306819</updated>
321
+      <workItem from="1542508308207" duration="34895000" />
322
+    </task>
323
+    <servers />
324
+  </component>
325
+  <component name="TestHistory">
326
+    <history-entry file="SetTest_removeTest - 2018.11.21 at 08h 36m 39s.xml">
327
+      <configuration name="SetTest.removeTest" configurationId="JUnit" />
328
+    </history-entry>
329
+    <history-entry file="SetTest_removeTest - 2018.11.21 at 08h 50m 36s.xml">
330
+      <configuration name="SetTest.removeTest" configurationId="JUnit" />
331
+    </history-entry>
332
+    <history-entry file="SetTest_removeTest - 2018.11.21 at 08h 53m 11s.xml">
333
+      <configuration name="SetTest.removeTest" configurationId="JUnit" />
334
+    </history-entry>
335
+    <history-entry file="SetTest_removeTest - 2018.11.21 at 08h 54m 00s.xml">
336
+      <configuration name="SetTest.removeTest" configurationId="JUnit" />
337
+    </history-entry>
338
+    <history-entry file="SetTest_removeTest - 2018.11.21 at 08h 58m 02s.xml">
339
+      <configuration name="SetTest.removeTest" configurationId="JUnit" />
340
+    </history-entry>
341
+    <history-entry file="SetTest_removeTest - 2018.11.21 at 09h 02m 37s.xml">
342
+      <configuration name="SetTest.removeTest" configurationId="JUnit" />
343
+    </history-entry>
344
+    <history-entry file="SetTest_removeTest - 2018.11.21 at 09h 02m 47s.xml">
345
+      <configuration name="SetTest.removeTest" configurationId="JUnit" />
346
+    </history-entry>
347
+    <history-entry file="SetTest_removeTest - 2018.11.21 at 09h 02m 52s.xml">
348
+      <configuration name="SetTest.removeTest" configurationId="JUnit" />
349
+    </history-entry>
350
+    <history-entry file="SetTest_removeTest - 2018.11.21 at 10h 46m 42s.xml">
351
+      <configuration name="SetTest.removeTest" configurationId="JUnit" />
352
+    </history-entry>
353
+    <history-entry file="All_in_generics - 2018.11.21 at 10h 46m 54s.xml">
354
+      <configuration name="All in generics" configurationId="JUnit" />
355
+    </history-entry>
356
+  </component>
357
+  <component name="TimeTrackingManager">
358
+    <option name="totallyTimeSpent" value="34895000" />
359
+  </component>
360
+  <component name="ToolWindowManager">
361
+    <frame x="121" y="51" width="951" height="709" extended-state="0" />
362
+    <layout>
363
+      <window_info id="Image Layers" />
364
+      <window_info id="Designer" />
365
+      <window_info id="UI Designer" />
366
+      <window_info id="Capture Tool" />
367
+      <window_info id="Favorites" side_tool="true" />
368
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.23322332" />
369
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
370
+      <window_info anchor="bottom" id="Messages" weight="0.3284091" />
371
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
372
+      <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
373
+      <window_info anchor="bottom" id="Terminal" />
374
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
375
+      <window_info anchor="bottom" id="Message" order="0" />
376
+      <window_info anchor="bottom" id="Find" order="1" />
377
+      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.32901135" />
378
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.39772728" />
379
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
380
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
381
+      <window_info anchor="bottom" id="TODO" order="6" />
382
+      <window_info anchor="right" id="Palette" />
383
+      <window_info active="true" anchor="right" id="Coverage" side_tool="true" visible="true" weight="0.38943896" />
384
+      <window_info anchor="right" id="Theme Preview" />
385
+      <window_info anchor="right" id="Capture Analysis" />
386
+      <window_info anchor="right" id="Palette&#9;" />
387
+      <window_info anchor="right" id="Database" />
388
+      <window_info anchor="right" id="Maven Projects" />
389
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
390
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
391
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
392
+    </layout>
393
+  </component>
394
+  <component name="TypeScriptGeneratedFilesManager">
395
+    <option name="version" value="1" />
396
+  </component>
397
+  <component name="VcsContentAnnotationSettings">
398
+    <option name="myLimit" value="2678400000" />
399
+  </component>
400
+  <component name="editorHistoryManager">
401
+    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/AbstractList.java">
402
+      <provider selected="true" editor-type-id="text-editor">
403
+        <state relative-caret-position="129">
404
+          <caret line="130" column="13" selection-start-line="130" selection-start-column="13" selection-end-line="130" selection-end-column="13" />
405
+          <folding>
406
+            <element signature="e#4449#4450#0" expanded="true" />
407
+            <element signature="e#4506#4507#0" expanded="true" />
408
+          </folding>
409
+        </state>
410
+      </provider>
411
+    </entry>
412
+    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/org/junit/Assert.java">
413
+      <provider selected="true" editor-type-id="text-editor">
414
+        <state relative-caret-position="115">
415
+          <caret line="630" selection-start-line="630" selection-end-line="630" />
416
+          <folding>
417
+            <element signature="e#4403#4404#0" expanded="true" />
418
+            <element signature="e#4455#4456#0" expanded="true" />
419
+            <element signature="e#24230#24231#0" expanded="true" />
420
+          </folding>
421
+        </state>
422
+      </provider>
423
+    </entry>
424
+    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/org/junit/runners/ParentRunner.java">
425
+      <provider selected="true" editor-type-id="text-editor">
426
+        <state relative-caret-position="130">
427
+          <caret line="327" selection-start-line="327" selection-end-line="327" />
428
+        </state>
429
+      </provider>
430
+    </entry>
431
+    <entry file="file://$PROJECT_DIR$/src/test/java/MapTest.java">
432
+      <provider selected="true" editor-type-id="text-editor">
433
+        <state>
434
+          <caret column="20" selection-start-column="20" selection-end-column="20" />
435
+        </state>
436
+      </provider>
437
+    </entry>
438
+    <entry file="file://$PROJECT_DIR$/src/test/java/ArraysTest2list.java">
439
+      <provider selected="true" editor-type-id="text-editor">
440
+        <state relative-caret-position="277">
441
+          <caret line="34" lean-forward="true" selection-end-line="34" />
442
+          <folding>
443
+            <element signature="e#0#520#0" expanded="true" />
444
+          </folding>
445
+        </state>
446
+      </provider>
447
+    </entry>
448
+    <entry file="file://$PROJECT_DIR$/src/main/java/Arraylists.java">
449
+      <provider selected="true" editor-type-id="text-editor">
450
+        <state relative-caret-position="277">
451
+          <caret line="56" lean-forward="true" selection-end-line="56" />
452
+          <folding>
453
+            <element signature="e#0#1276#0" expanded="true" />
454
+          </folding>
455
+        </state>
456
+      </provider>
457
+    </entry>
458
+    <entry file="file://$PROJECT_DIR$/src/test/java/ArrayListTest.java">
459
+      <provider selected="true" editor-type-id="text-editor">
460
+        <state relative-caret-position="-1364">
461
+          <caret line="70" column="34" selection-start-line="70" selection-start-column="34" selection-end-line="70" selection-end-column="34" />
462
+          <folding>
463
+            <element signature="imports" expanded="true" />
464
+          </folding>
465
+        </state>
466
+      </provider>
467
+    </entry>
468
+    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/org/junit/internal/runners/model/ReflectiveCallable.java">
469
+      <provider selected="true" editor-type-id="text-editor">
470
+        <state relative-caret-position="180">
471
+          <caret line="12" selection-start-line="12" selection-end-line="12" />
472
+        </state>
473
+      </provider>
474
+    </entry>
475
+    <entry file="file://$PROJECT_DIR$/src/test/java/SetTest.java">
476
+      <provider selected="true" editor-type-id="text-editor">
477
+        <state relative-caret-position="776">
478
+          <caret line="59" column="28" lean-forward="true" selection-start-line="59" selection-start-column="28" selection-end-line="59" selection-end-column="28" />
479
+          <folding>
480
+            <element signature="imports" expanded="true" />
481
+          </folding>
482
+        </state>
483
+      </provider>
484
+    </entry>
485
+    <entry file="file://$PROJECT_DIR$/src/main/java/Maps.java">
486
+      <provider selected="true" editor-type-id="text-editor">
487
+        <state>
488
+          <caret column="17" selection-start-column="17" selection-end-column="17" />
489
+        </state>
490
+      </provider>
491
+    </entry>
492
+    <entry file="file://$PROJECT_DIR$/src/main/java/Set.java">
493
+      <provider selected="true" editor-type-id="text-editor">
494
+        <state relative-caret-position="90">
495
+          <caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
496
+          <folding>
497
+            <element signature="imports" expanded="true" />
498
+            <element signature="e#62#63#0" expanded="true" />
499
+            <element signature="e#100#101#0" expanded="true" />
500
+            <element signature="e#294#295#0" expanded="true" />
501
+            <element signature="e#317#318#0" expanded="true" />
502
+          </folding>
503
+        </state>
504
+      </provider>
505
+    </entry>
506
+    <entry file="file://$PROJECT_DIR$/src/main/java/ArrayList.java">
507
+      <provider selected="true" editor-type-id="text-editor">
508
+        <state relative-caret-position="113">
509
+          <caret line="73" column="24" selection-start-line="73" selection-start-column="24" selection-end-line="73" selection-end-column="24" />
510
+          <folding>
511
+            <element signature="e#300#330#0" expanded="true" />
512
+            <element signature="e#525#555#0" expanded="true" />
513
+          </folding>
514
+        </state>
515
+      </provider>
516
+    </entry>
517
+  </component>
518
+  <component name="masterDetails">
519
+    <states>
520
+      <state key="ArtifactsStructureConfigurable.UI">
521
+        <settings>
522
+          <artifact-editor />
523
+          <splitter-proportions>
524
+            <option name="proportions">
525
+              <list>
526
+                <option value="0.2" />
527
+              </list>
528
+            </option>
529
+          </splitter-proportions>
530
+        </settings>
531
+      </state>
532
+      <state key="FacetStructureConfigurable.UI">
533
+        <settings>
534
+          <last-edited>No facets are configured</last-edited>
535
+          <splitter-proportions>
536
+            <option name="proportions">
537
+              <list>
538
+                <option value="0.2" />
539
+              </list>
540
+            </option>
541
+          </splitter-proportions>
542
+        </settings>
543
+      </state>
544
+      <state key="GlobalLibrariesConfigurable.UI">
545
+        <settings>
546
+          <splitter-proportions>
547
+            <option name="proportions">
548
+              <list>
549
+                <option value="0.2" />
550
+              </list>
551
+            </option>
552
+          </splitter-proportions>
553
+        </settings>
554
+      </state>
555
+      <state key="JdkListConfigurable.UI">
556
+        <settings>
557
+          <last-edited>1.8</last-edited>
558
+          <splitter-proportions>
559
+            <option name="proportions">
560
+              <list>
561
+                <option value="0.2" />
562
+              </list>
563
+            </option>
564
+          </splitter-proportions>
565
+        </settings>
566
+      </state>
567
+      <state key="ModuleStructureConfigurable.UI">
568
+        <settings>
569
+          <last-edited>generics</last-edited>
570
+          <splitter-proportions>
571
+            <option name="proportions">
572
+              <list>
573
+                <option value="0.2" />
574
+                <option value="0.6" />
575
+              </list>
576
+            </option>
577
+          </splitter-proportions>
578
+        </settings>
579
+      </state>
580
+      <state key="ProjectJDKs.UI">
581
+        <settings>
582
+          <last-edited>1.8</last-edited>
583
+          <splitter-proportions>
584
+            <option name="proportions">
585
+              <list>
586
+                <option value="0.2" />
587
+              </list>
588
+            </option>
589
+          </splitter-proportions>
590
+        </settings>
591
+      </state>
592
+      <state key="ProjectLibrariesConfigurable.UI">
593
+        <settings>
594
+          <last-edited>Maven: junit:junit:4.12</last-edited>
595
+          <splitter-proportions>
596
+            <option name="proportions">
597
+              <list>
598
+                <option value="0.2" />
599
+              </list>
600
+            </option>
601
+          </splitter-proportions>
602
+        </settings>
603
+      </state>
604
+    </states>
605
+  </component>
606
+</project>

+ 16
- 0
generics.iml 查看文件

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
4
+    <output url="file://$MODULE_DIR$/target/classes" />
5
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
+    <content url="file://$MODULE_DIR$">
7
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
9
+      <excludeFolder url="file://$MODULE_DIR$/target" />
10
+    </content>
11
+    <orderEntry type="inheritedJdk" />
12
+    <orderEntry type="sourceFolder" forTests="false" />
13
+    <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
14
+    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
15
+  </component>
16
+</module>

+ 0
- 0
src/main/java/.deleteme 查看文件


+ 182
- 0
src/main/java/ArrayList.java 查看文件

@@ -0,0 +1,182 @@
1
+import java.util.Arrays;
2
+
3
+public class ArrayList <T> implements Cloneable {
4
+
5
+
6
+    private T[] data;
7
+    private int count;
8
+    private static final int default_capacity = 10;
9
+
10
+    public ArrayList(){
11
+        this.data = (T[])new Object [default_capacity];
12
+        this.count =0;
13
+
14
+    }
15
+
16
+    public int size (){
17
+
18
+        return count;
19
+
20
+    }
21
+
22
+    @SuppressWarnings("unchecked")
23
+    public T get (int i){
24
+
25
+        if(i >= count || i <0){
26
+
27
+            throw new IndexOutOfBoundsException("Index: " + i + ", Size " + i);
28
+
29
+        }
30
+            return (T) data[i];
31
+    }
32
+
33
+    @SuppressWarnings("unchecked")
34
+    public T set (int i , T t){
35
+
36
+        if(i>= count || i <0){
37
+
38
+            throw new IndexOutOfBoundsException("Index: " + i + ", Size" + i);
39
+
40
+        }
41
+
42
+        T oldobj = (T)data[i];
43
+        data[i] = t;
44
+        return oldobj;
45
+    }
46
+
47
+    public Boolean adding(T t){
48
+//
49
+//        if (t == null){
50
+//            return false;
51
+//        } kinda broke oops
52
+        data[count] = t;
53
+        count++;
54
+        ensureCap();
55
+        return true;
56
+
57
+    }
58
+
59
+    public Boolean addingIndex(int index,T t ){
60
+
61
+        T[] newArray = Arrays.copyOfRange(data,0,index);
62
+        T[] newArray2 = Arrays.copyOfRange(data,index,data.length);
63
+
64
+        data = newArray;
65
+        add(t);
66
+        data = merge(newArray,newArray2);
67
+        return true;
68
+
69
+    }
70
+
71
+
72
+    public T [] merge (T[] arr1, T[] arr2){
73
+
74
+        T[] arrmerge =  (T []) new Object[arr1.length + arr2.length];
75
+        int counter = 0;
76
+
77
+        for (T t: arr1) {
78
+                arrmerge[counter] = t;
79
+                counter ++;
80
+        }
81
+        for (T t : arr2) {
82
+            arrmerge[counter] = t;
83
+            counter++;
84
+        }
85
+        return arrmerge;
86
+
87
+    }
88
+
89
+    public void add (T t){
90
+
91
+        if(count == data.length){
92
+
93
+            ensureCap();
94
+
95
+        }
96
+        data[count++] = t;
97
+
98
+
99
+    }
100
+    public T remove(int i) {
101
+
102
+
103
+        if(i < 0 || i >= count) {
104
+
105
+            throw new IndexOutOfBoundsException();
106
+        }
107
+        T oldT = (T)data[i];
108
+            for(int j = i; j < count-1; j++){
109
+
110
+                data[j] = data[j+1];
111
+
112
+            }
113
+        count --;
114
+        data[count] = null;
115
+        return oldT;
116
+        }
117
+
118
+
119
+
120
+
121
+    public void clear (){
122
+
123
+        for (int j = 1; j < data.length ; j++) {
124
+            data[j] = null;
125
+            count--;
126
+
127
+        }
128
+
129
+    }
130
+
131
+
132
+
133
+
134
+    public Boolean isEmpty(){
135
+
136
+        return count==0;
137
+
138
+    }
139
+    public Integer getIndexOf(T t){
140
+        for (int i = 0; i <count; i++) {
141
+
142
+
143
+            if(data[i].equals(t))
144
+                return i;
145
+
146
+        }
147
+        return -1;
148
+    }
149
+
150
+
151
+
152
+    public Boolean contains(T t){
153
+
154
+        for (int i = 0; i < size(); i++) {
155
+            if(data[i].equals(t)){
156
+
157
+                return true;
158
+
159
+            }
160
+        }
161
+        return false;
162
+    }
163
+
164
+    public ArrayList<T> clone (ArrayList<T> arrayList) throws CloneNotSupportedException{
165
+            ArrayList<T>clone = (ArrayList<T>)super.clone();
166
+            return clone;
167
+
168
+    }
169
+
170
+
171
+    public void ensureCap(){
172
+
173
+        if(count < data.length) return;
174
+
175
+            int newSize = data.length * 2;
176
+            data = Arrays.copyOf(data, newSize);
177
+
178
+    }
179
+
180
+
181
+
182
+}

+ 56
- 0
src/main/java/Arraylists.java 查看文件

@@ -0,0 +1,56 @@
1
+//import java.util.AbstractList;
2
+//
3
+//public class Arraylists<E> extends AbstractList<E>{
4
+//
5
+//    private E[] data;
6
+//    private int count = 0;
7
+//    private static final int INITIALcap = 16;
8
+//
9
+//    @SuppressWarnings("unchecked")
10
+//    public Arraylists() {
11
+//        //we cannot use type variables as array constructors.
12
+//        //so no new E[INITIALcap]
13
+//
14
+//        data = (E[]) new Object[INITIALcap];
15
+//        //create an object[] and then cast to E[]
16
+//        //the compiler will warn about it but is safe, using @SuppressWarnings ("unchecked") to emphasize that fact.
17
+//    }
18
+//
19
+//    @Override
20
+//    public int size() {
21
+//        return count;
22
+//    }
23
+//
24
+//    public boolean isEmpty(){
25
+//        return count ==0;
26
+//    }
27
+//
28
+//    @Override
29
+//    public E get(int index) {
30
+//        if (index < 0 || index >= count) {
31
+//
32
+//            throw new IndexOutOfBoundsException();
33
+//        }
34
+//        return data[index];
35
+//    }
36
+//
37
+//    public E set(int index, E element){
38
+//
39
+//        if(index < 0 || index >= count)
40
+//            throw new IndexOutOfBoundsException();
41
+//
42
+//        E oldEl = data[index];
43
+//        data[index] = element;
44
+//        return oldEl;
45
+//
46
+//    }
47
+//    public E remove (int index){
48
+//
49
+//        return null;
50
+//
51
+//    }
52
+//
53
+//}
54
+//
55
+//
56
+//

+ 2
- 0
src/main/java/Maps.java 查看文件

@@ -0,0 +1,2 @@
1
+public class Maps {
2
+}

+ 42
- 0
src/main/java/Set.java 查看文件

@@ -0,0 +1,42 @@
1
+import java.util.Iterator;
2
+import java.util.NoSuchElementException;
3
+
4
+public class Set <T> implements Cloneable {
5
+
6
+    ArrayList<T>Set;
7
+
8
+
9
+    public Set(){
10
+        Set = new ArrayList<>();
11
+    }
12
+
13
+
14
+    public int size (){
15
+        return Set.size();
16
+    }
17
+
18
+    public Boolean add(T t){
19
+
20
+        if(!Set.contains(t)){
21
+
22
+            Set.adding(t);
23
+        return true;}
24
+        else{ return false;}
25
+    }
26
+    public boolean remove (T t){
27
+
28
+        if(Set.contains(t)){
29
+            Set.remove(Set.getIndexOf(t));
30
+            return true;
31
+        }else {
32
+
33
+            return false;
34
+        }
35
+
36
+    }
37
+    public boolean contains (T t){
38
+
39
+        return Set.contains(t);
40
+    }
41
+
42
+}

+ 208
- 0
src/test/java/ArrayListTest.java 查看文件

@@ -0,0 +1,208 @@
1
+import org.junit.Assert;
2
+import org.junit.Before;
3
+import org.junit.Test;
4
+
5
+import static jdk.nashorn.internal.objects.NativeArray.lastIndexOf;
6
+
7
+public class ArrayListTest {
8
+
9
+
10
+
11
+    @Before
12
+    public void setup(){
13
+
14
+
15
+    }
16
+
17
+    @Test
18
+    public void AddTest(){
19
+
20
+        //Given
21
+        ArrayList arrayList = new ArrayList();
22
+
23
+     //When
24
+
25
+        for (int i = 0; i < 19; i++) {
26
+            arrayList.add(i);
27
+        }
28
+
29
+        int actual = arrayList.size();
30
+        int expecting = 19;
31
+
32
+
33
+        //Then
34
+
35
+        Assert.assertEquals(actual,expecting);
36
+
37
+
38
+    }
39
+
40
+    @Test
41
+    public void addBoolean(){
42
+
43
+        //Given
44
+        ArrayList arrayList = new ArrayList();
45
+
46
+        //When
47
+        int r = 2;
48
+
49
+         Boolean actual= arrayList.adding(r);
50
+
51
+        //Then
52
+        Assert.assertTrue(actual);
53
+
54
+    }
55
+    @Test
56
+    public void addBooleanIndex(){
57
+
58
+        //Given
59
+        ArrayList arrayList = new ArrayList();
60
+
61
+        //When
62
+        int r = 2;
63
+
64
+
65
+
66
+        for (int i = 0; i < 4; i++) {
67
+            arrayList.add(i);
68
+        }
69
+        Boolean actual= arrayList.addingIndex(9,r);
70
+        //Then
71
+        Assert.assertTrue(actual);
72
+
73
+    }
74
+
75
+    @Test
76
+    public void removeTest(){
77
+        //Given
78
+        ArrayList arrayList = new ArrayList();
79
+
80
+        //When
81
+
82
+        for (int i = 0; i < 19; i++) {
83
+            arrayList.add(i);
84
+        }
85
+        arrayList.remove(10);
86
+        int actual = arrayList.size();
87
+        int expecting = 18;
88
+
89
+
90
+        //Then
91
+
92
+        Assert.assertEquals(expecting,actual);
93
+    }
94
+
95
+    @Test
96
+    public  void containsTest(){
97
+
98
+        //Given
99
+
100
+        ArrayList arrayList = new ArrayList();
101
+
102
+        //When
103
+        for (int i = 0; i < 4; i++) {
104
+            arrayList.add(i);
105
+        }
106
+       Boolean actual = arrayList.contains(2);
107
+
108
+        //Then
109
+
110
+        Assert.assertTrue(actual);
111
+
112
+    }
113
+
114
+    @Test
115
+    public void getTest(){
116
+
117
+        //Given
118
+
119
+        ArrayList arrayList = new ArrayList();
120
+
121
+        //When
122
+        for (int i = 0; i < 4; i++) {
123
+            arrayList.add(i);
124
+        }
125
+        //Then
126
+
127
+        int expect = 2;
128
+        Object actual = arrayList.get(2);
129
+        Assert.assertEquals(expect,actual);
130
+
131
+    }
132
+
133
+    @Test
134
+    public void setTest(){
135
+
136
+        //Given
137
+        ArrayList arrayList = new ArrayList();
138
+        //When
139
+        for (int i = 0; i < 4; i++) {
140
+            arrayList.add(i);
141
+        }
142
+        //Then
143
+        int expect = 7;
144
+         arrayList.set(3,6);
145
+        arrayList.set(3,7);
146
+        Object actual = arrayList.get(3);
147
+        Assert.assertEquals(expect,actual);
148
+
149
+
150
+    }
151
+    @Test
152
+    public void clearTest(){
153
+
154
+        //Given
155
+        ArrayList arrayList = new ArrayList();
156
+
157
+        //When
158
+        for (int i = 0; i < 19; i++) {
159
+            arrayList.add(i);
160
+        }
161
+        arrayList.clear();
162
+        //Then
163
+        int actual = arrayList.size();
164
+        int expecting = 0;
165
+
166
+        Assert.assertEquals(expecting,actual);
167
+
168
+
169
+    }
170
+
171
+    @Test
172
+    public void itsEmptyTest(){
173
+
174
+        //Given
175
+        ArrayList arrayList = new ArrayList();
176
+       // arrayList.add(4);
177
+        //When
178
+        Boolean actual = arrayList.isEmpty();
179
+        //Then
180
+        Assert.assertTrue(actual);
181
+
182
+
183
+    }
184
+
185
+
186
+
187
+
188
+
189
+    @Test
190
+    public void indexOfTest(){
191
+
192
+        //Given
193
+
194
+        ArrayList arrayList = new ArrayList();
195
+
196
+        //When
197
+        for (int i = 0; i < 5; i++) {
198
+            arrayList.add(i);
199
+        }
200
+        int expecting  = 3;
201
+        int actual = arrayList.getIndexOf(3);
202
+
203
+        //Then
204
+
205
+        Assert.assertEquals(expecting,actual);
206
+    }
207
+
208
+}

+ 34
- 0
src/test/java/ArraysTest2list.java 查看文件

@@ -0,0 +1,34 @@
1
+//import org.junit.Assert;
2
+//import org.junit.Test;
3
+//
4
+//public class ArraysTest2list <E> {
5
+//
6
+//    private Arraylists <E> arraylists;
7
+//
8
+//    public ArraysTest2list(){
9
+//
10
+//
11
+//    }
12
+//
13
+//    @Test
14
+//    public void testset(){
15
+//
16
+//
17
+//
18
+//        E i = (E)new Object();
19
+//        E x = (E)new Object();
20
+//
21
+//
22
+//        arraylists.add(1,i);
23
+//        arraylists.set(1,x);
24
+//        int expected = 1;
25
+//        int actual = arraylists.size();
26
+//
27
+//
28
+//
29
+//        Assert.assertEquals(expected,actual);
30
+//
31
+//
32
+//
33
+//    }
34
+//}

+ 2
- 0
src/test/java/MapTest.java 查看文件

@@ -0,0 +1,2 @@
1
+public class MapTest {
2
+}

+ 68
- 0
src/test/java/SetTest.java 查看文件

@@ -0,0 +1,68 @@
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+public class SetTest {
5
+
6
+        Set s = new Set();
7
+
8
+        @Test
9
+        public void add (){
10
+
11
+                //Given
12
+
13
+
14
+                //When
15
+                Boolean actual = s.add(3);
16
+                //then
17
+
18
+                Assert.assertTrue(actual);
19
+
20
+        }
21
+        @Test
22
+        public void addDouble (){
23
+
24
+                //Given
25
+                s.add(3);
26
+
27
+                //When
28
+                Boolean actual = s.add(3);
29
+                //then
30
+
31
+                Assert.assertFalse(actual);
32
+
33
+        }
34
+
35
+        @Test
36
+        public void sizetest(){
37
+
38
+                //Given
39
+                s.add(2);
40
+                s.add(4);
41
+
42
+                //When
43
+                 int actual = s.size();
44
+                 int expected = 2;
45
+                //then
46
+
47
+                Assert.assertEquals(expected,actual);
48
+
49
+        }
50
+
51
+        @Test
52
+        public void removeTest(){
53
+
54
+                //Given
55
+                s.add(4);
56
+                s.add(5);
57
+
58
+
59
+                //When
60
+                s.remove(4);
61
+
62
+
63
+                //Then
64
+
65
+                Assert.assertFalse(s.contains(4));
66
+
67
+        }
68
+}