David Thornley 6 lat temu
rodzic
commit
e382f68256

+ 1
- 0
.idea/.name Wyświetl plik

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

+ 16
- 0
.idea/compiler.xml Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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>

+ 716
- 0
.idea/workspace.xml Wyświetl plik

@@ -0,0 +1,716 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="0b80d01c-8dc8-4752-8c2c-1c71c3abd01e" name="Default" comment="">
5
+      <change afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" afterDir="false" />
7
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" afterDir="false" />
8
+      <change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
9
+      <change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
10
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
11
+      <change afterPath="$PROJECT_DIR$/generics.iml" afterDir="false" />
12
+      <change afterPath="$PROJECT_DIR$/src/main/java/MyArrayList.java" afterDir="false" />
13
+      <change afterPath="$PROJECT_DIR$/src/main/java/MySet.java" afterDir="false" />
14
+      <change afterPath="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" afterDir="false" />
15
+      <change afterPath="$PROJECT_DIR$/src/test/java/MySetTest.java" afterDir="false" />
16
+      <change beforePath="$PROJECT_DIR$/src/main/java/.deleteme" beforeDir="false" />
17
+      <change beforePath="$PROJECT_DIR$/src/test/java/.deleteme" beforeDir="false" />
18
+    </list>
19
+    <ignored path="$PROJECT_DIR$/target/" />
20
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
21
+    <option name="TRACKING_ENABLED" value="true" />
22
+    <option name="SHOW_DIALOG" value="false" />
23
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
24
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
25
+    <option name="LAST_RESOLUTION" value="IGNORE" />
26
+  </component>
27
+  <component name="ErrorTreeViewConfiguration">
28
+    <option name="hideWarnings" value="true" />
29
+    <option name="HIDE_WARNINGS" value="true" />
30
+  </component>
31
+  <component name="FileEditorManager">
32
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
33
+      <file leaf-file-name="MySet.java" pinned="false" current-in-tab="false">
34
+        <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
35
+          <provider selected="true" editor-type-id="text-editor">
36
+            <state relative-caret-position="301">
37
+              <caret line="84" column="30" selection-start-line="84" selection-start-column="30" selection-end-line="84" selection-end-column="30" />
38
+              <folding>
39
+                <element signature="e#97#98#0" expanded="true" />
40
+                <element signature="e#131#132#0" expanded="true" />
41
+                <element signature="e#1734#1735#0" expanded="true" />
42
+                <element signature="e#1759#1760#0" expanded="true" />
43
+              </folding>
44
+            </state>
45
+          </provider>
46
+        </entry>
47
+      </file>
48
+      <file leaf-file-name="MySetTest.java" pinned="false" current-in-tab="true">
49
+        <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
50
+          <provider selected="true" editor-type-id="text-editor">
51
+            <state relative-caret-position="538">
52
+              <caret line="144" lean-forward="true" selection-start-line="144" selection-end-line="144" />
53
+            </state>
54
+          </provider>
55
+        </entry>
56
+      </file>
57
+      <file leaf-file-name="README.md" pinned="false" current-in-tab="false">
58
+        <entry file="file://$PROJECT_DIR$/README.md">
59
+          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
60
+            <state split_layout="SPLIT">
61
+              <first_editor />
62
+              <second_editor />
63
+            </state>
64
+          </provider>
65
+        </entry>
66
+      </file>
67
+      <file leaf-file-name="MyArrayList.java" pinned="false" current-in-tab="false">
68
+        <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
69
+          <provider selected="true" editor-type-id="text-editor">
70
+            <state relative-caret-position="166">
71
+              <caret line="37" column="13" lean-forward="true" selection-start-line="37" selection-start-column="13" selection-end-line="37" selection-end-column="13" />
72
+            </state>
73
+          </provider>
74
+        </entry>
75
+      </file>
76
+    </leaf>
77
+  </component>
78
+  <component name="FileTemplateManagerImpl">
79
+    <option name="RECENT_TEMPLATES">
80
+      <list>
81
+        <option value="Interface" />
82
+        <option value="Class" />
83
+        <option value="JUnit4 Test Class" />
84
+      </list>
85
+    </option>
86
+  </component>
87
+  <component name="FindInProjectRecents">
88
+    <findStrings>
89
+      <find>elements</find>
90
+      <find>tempArray</find>
91
+      <find>array</find>
92
+    </findStrings>
93
+    <replaceStrings>
94
+      <replace>temp</replace>
95
+      <replace>set</replace>
96
+    </replaceStrings>
97
+  </component>
98
+  <component name="Git.Settings">
99
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
100
+  </component>
101
+  <component name="IdeDocumentHistory">
102
+    <option name="CHANGED_PATHS">
103
+      <list>
104
+        <option value="$PROJECT_DIR$/src/main/java/ArrayList.java" />
105
+        <option value="$PROJECT_DIR$/src/test/java/MyArrayListTest.java" />
106
+        <option value="$PROJECT_DIR$/src/main/java/MyArrayList.java" />
107
+        <option value="$PROJECT_DIR$/src/test/java/MySetTest.java" />
108
+        <option value="$PROJECT_DIR$/src/main/java/MySet.java" />
109
+      </list>
110
+    </option>
111
+  </component>
112
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
113
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
114
+  <component name="JsGulpfileManager">
115
+    <detection-done>true</detection-done>
116
+    <sorting>DEFINITION_ORDER</sorting>
117
+  </component>
118
+  <component name="NodePackageJsonFileManager">
119
+    <packageJsonPaths />
120
+  </component>
121
+  <component name="ProjectFrameBounds" fullScreen="true">
122
+    <option name="x" value="-335" />
123
+    <option name="y" value="-1080" />
124
+    <option name="width" value="1920" />
125
+    <option name="height" value="1080" />
126
+  </component>
127
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true">
128
+    <ConfirmationsSetting value="2" id="Add" />
129
+  </component>
130
+  <component name="ProjectView">
131
+    <navigator proportions="" version="1">
132
+      <foldersAlwaysOnTop value="true" />
133
+    </navigator>
134
+    <panes>
135
+      <pane id="AndroidView" />
136
+      <pane id="ProjectPane">
137
+        <subPane>
138
+          <expand>
139
+            <path>
140
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
141
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
142
+            </path>
143
+            <path>
144
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
145
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
146
+              <item name="src" type="462c0819:PsiDirectoryNode" />
147
+            </path>
148
+            <path>
149
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
150
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
151
+              <item name="src" type="462c0819:PsiDirectoryNode" />
152
+              <item name="main" type="462c0819:PsiDirectoryNode" />
153
+            </path>
154
+            <path>
155
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
156
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
157
+              <item name="src" type="462c0819:PsiDirectoryNode" />
158
+              <item name="main" type="462c0819:PsiDirectoryNode" />
159
+              <item name="java" type="462c0819:PsiDirectoryNode" />
160
+            </path>
161
+            <path>
162
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
163
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
164
+              <item name="src" type="462c0819:PsiDirectoryNode" />
165
+              <item name="test" type="462c0819:PsiDirectoryNode" />
166
+            </path>
167
+            <path>
168
+              <item name="generics" type="b2602c69:ProjectViewProjectNode" />
169
+              <item name="CR-MicroLabs-Generics-MyArrayList" type="462c0819:PsiDirectoryNode" />
170
+              <item name="src" type="462c0819:PsiDirectoryNode" />
171
+              <item name="test" type="462c0819:PsiDirectoryNode" />
172
+              <item name="java" type="462c0819:PsiDirectoryNode" />
173
+            </path>
174
+          </expand>
175
+          <select />
176
+        </subPane>
177
+      </pane>
178
+      <pane id="PackagesPane" />
179
+      <pane id="Scope" />
180
+    </panes>
181
+  </component>
182
+  <component name="PropertiesComponent">
183
+    <property name="WebServerToolWindowFactoryState" value="false" />
184
+    <property name="aspect.path.notification.shown" value="true" />
185
+    <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
186
+    <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit4" value="" />
187
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
188
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
189
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
190
+    <property name="project.structure.last.edited" value="Modules" />
191
+    <property name="project.structure.proportion" value="0.15" />
192
+    <property name="project.structure.side.proportion" value="0.2" />
193
+    <property name="settings.editor.selected.configurable" value="preferences.keymap" />
194
+  </component>
195
+  <component name="RecentsManager">
196
+    <key name="CreateTestDialog.RecentsKey">
197
+      <recent name="" />
198
+    </key>
199
+    <key name="CreateTestDialog.Recents.Supers">
200
+      <recent name="" />
201
+    </key>
202
+    <key name="CreateClassDialog.RecentsKey">
203
+      <recent name="" />
204
+    </key>
205
+  </component>
206
+  <component name="RunDashboard">
207
+    <option name="ruleStates">
208
+      <list>
209
+        <RuleState>
210
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
211
+        </RuleState>
212
+        <RuleState>
213
+          <option name="name" value="StatusDashboardGroupingRule" />
214
+        </RuleState>
215
+      </list>
216
+    </option>
217
+  </component>
218
+  <component name="RunManager" selected="JUnit.MySetTest.hashCodeTest">
219
+    <configuration default="true" type="Application" factoryName="Application">
220
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
221
+    </configuration>
222
+    <configuration name="MySetTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
223
+      <module name="generics" />
224
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
225
+      <option name="ALTERNATIVE_JRE_PATH" />
226
+      <option name="PACKAGE_NAME" value="" />
227
+      <option name="MAIN_CLASS_NAME" value="MySetTest" />
228
+      <option name="METHOD_NAME" />
229
+      <option name="TEST_OBJECT" value="class" />
230
+      <option name="VM_PARAMETERS" value="-ea" />
231
+      <option name="PARAMETERS" />
232
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
233
+      <option name="PASS_PARENT_ENVS" value="true" />
234
+      <option name="TEST_SEARCH_SCOPE">
235
+        <value defaultName="singleModule" />
236
+      </option>
237
+      <patterns />
238
+    </configuration>
239
+    <configuration name="MySetTest.equals" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
240
+      <module name="generics" />
241
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
242
+      <option name="ALTERNATIVE_JRE_PATH" />
243
+      <option name="PACKAGE_NAME" value="" />
244
+      <option name="MAIN_CLASS_NAME" value="MySetTest" />
245
+      <option name="METHOD_NAME" value="equals" />
246
+      <option name="TEST_OBJECT" value="method" />
247
+      <option name="VM_PARAMETERS" value="-ea" />
248
+      <option name="PARAMETERS" />
249
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
250
+      <option name="PASS_PARENT_ENVS" value="true" />
251
+      <option name="TEST_SEARCH_SCOPE">
252
+        <value defaultName="singleModule" />
253
+      </option>
254
+      <patterns />
255
+    </configuration>
256
+    <configuration name="MySetTest.hashCodeTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
257
+      <module name="generics" />
258
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
259
+      <option name="ALTERNATIVE_JRE_PATH" />
260
+      <option name="PACKAGE_NAME" value="" />
261
+      <option name="MAIN_CLASS_NAME" value="MySetTest" />
262
+      <option name="METHOD_NAME" value="hashCodeTest" />
263
+      <option name="TEST_OBJECT" value="method" />
264
+      <option name="VM_PARAMETERS" value="-ea" />
265
+      <option name="PARAMETERS" />
266
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
267
+      <option name="PASS_PARENT_ENVS" value="true" />
268
+      <option name="TEST_SEARCH_SCOPE">
269
+        <value defaultName="singleModule" />
270
+      </option>
271
+      <patterns />
272
+    </configuration>
273
+    <configuration name="MySetTest.isEmpty" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
274
+      <module name="generics" />
275
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
276
+      <option name="ALTERNATIVE_JRE_PATH" />
277
+      <option name="PACKAGE_NAME" value="" />
278
+      <option name="MAIN_CLASS_NAME" value="MySetTest" />
279
+      <option name="METHOD_NAME" value="isEmpty" />
280
+      <option name="TEST_OBJECT" value="method" />
281
+      <option name="VM_PARAMETERS" value="-ea" />
282
+      <option name="PARAMETERS" />
283
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
284
+      <option name="PASS_PARENT_ENVS" value="true" />
285
+      <option name="TEST_SEARCH_SCOPE">
286
+        <value defaultName="singleModule" />
287
+      </option>
288
+      <patterns />
289
+    </configuration>
290
+    <configuration name="MySetTest.isEmptyFalse" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
291
+      <module name="generics" />
292
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
293
+      <option name="ALTERNATIVE_JRE_PATH" />
294
+      <option name="PACKAGE_NAME" value="" />
295
+      <option name="MAIN_CLASS_NAME" value="MySetTest" />
296
+      <option name="METHOD_NAME" value="isEmptyFalse" />
297
+      <option name="TEST_OBJECT" value="method" />
298
+      <option name="VM_PARAMETERS" value="-ea" />
299
+      <option name="PARAMETERS" />
300
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
301
+      <option name="PASS_PARENT_ENVS" value="true" />
302
+      <option name="TEST_SEARCH_SCOPE">
303
+        <value defaultName="singleModule" />
304
+      </option>
305
+      <patterns />
306
+    </configuration>
307
+    <configuration default="true" type="JUnit" factoryName="JUnit">
308
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
309
+      <option name="ALTERNATIVE_JRE_PATH" />
310
+      <option name="PACKAGE_NAME" />
311
+      <option name="MAIN_CLASS_NAME" />
312
+      <option name="METHOD_NAME" />
313
+      <option name="TEST_OBJECT" value="class" />
314
+      <option name="VM_PARAMETERS" value="-ea" />
315
+      <option name="PARAMETERS" />
316
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
317
+      <option name="PASS_PARENT_ENVS" value="true" />
318
+      <option name="TEST_SEARCH_SCOPE">
319
+        <value defaultName="singleModule" />
320
+      </option>
321
+      <patterns />
322
+    </configuration>
323
+    <configuration default="true" type="TestNG" factoryName="TestNG">
324
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
325
+      <option name="ALTERNATIVE_JRE_PATH" />
326
+      <option name="SUITE_NAME" />
327
+      <option name="PACKAGE_NAME" />
328
+      <option name="MAIN_CLASS_NAME" />
329
+      <option name="METHOD_NAME" />
330
+      <option name="GROUP_NAME" />
331
+      <option name="TEST_OBJECT" value="CLASS" />
332
+      <option name="VM_PARAMETERS" value="-ea" />
333
+      <option name="PARAMETERS" />
334
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
335
+      <option name="OUTPUT_DIRECTORY" />
336
+      <option name="PASS_PARENT_ENVS" value="true" />
337
+      <option name="TEST_SEARCH_SCOPE">
338
+        <value defaultName="singleModule" />
339
+      </option>
340
+      <option name="USE_DEFAULT_REPORTERS" value="false" />
341
+      <option name="PROPERTIES_FILE" />
342
+      <properties />
343
+      <listeners />
344
+    </configuration>
345
+    <list>
346
+      <item itemvalue="JUnit.MySetTest.isEmpty" />
347
+      <item itemvalue="JUnit.MySetTest.isEmptyFalse" />
348
+      <item itemvalue="JUnit.MySetTest.hashCodeTest" />
349
+      <item itemvalue="JUnit.MySetTest.equals" />
350
+      <item itemvalue="JUnit.MySetTest" />
351
+    </list>
352
+    <recent_temporary>
353
+      <list>
354
+        <item itemvalue="JUnit.MySetTest.hashCodeTest" />
355
+        <item itemvalue="JUnit.MySetTest" />
356
+        <item itemvalue="JUnit.MySetTest.equals" />
357
+        <item itemvalue="JUnit.MySetTest.isEmptyFalse" />
358
+        <item itemvalue="JUnit.MySetTest.isEmpty" />
359
+      </list>
360
+    </recent_temporary>
361
+  </component>
362
+  <component name="SvnConfiguration">
363
+    <configuration />
364
+  </component>
365
+  <component name="TaskManager">
366
+    <task active="true" id="Default" summary="Default task">
367
+      <changelist id="0b80d01c-8dc8-4752-8c2c-1c71c3abd01e" name="Default" comment="" />
368
+      <created>1529443663030</created>
369
+      <option name="number" value="Default" />
370
+      <option name="presentableId" value="Default" />
371
+      <updated>1529443663030</updated>
372
+      <workItem from="1529443664610" duration="16544000" />
373
+      <workItem from="1529601526232" duration="594000" />
374
+      <workItem from="1529952208068" duration="3383000" />
375
+      <workItem from="1530394359701" duration="6613000" />
376
+    </task>
377
+    <servers />
378
+  </component>
379
+  <component name="TestHistory">
380
+    <history-entry file="MySetTest_hashCodeTest - 2018.07.01 at 14h 19m 10s.xml">
381
+      <configuration name="MySetTest.hashCodeTest" configurationId="JUnit" />
382
+    </history-entry>
383
+    <history-entry file="MySetTest_hashCodeTest - 2018.07.01 at 14h 19m 42s.xml">
384
+      <configuration name="MySetTest.hashCodeTest" configurationId="JUnit" />
385
+    </history-entry>
386
+    <history-entry file="MySetTest_equals - 2018.07.01 at 14h 20m 42s.xml">
387
+      <configuration name="MySetTest.equals" configurationId="JUnit" />
388
+    </history-entry>
389
+    <history-entry file="MySetTest_equals - 2018.07.01 at 14h 44m 39s.xml">
390
+      <configuration name="MySetTest.equals" configurationId="JUnit" />
391
+    </history-entry>
392
+    <history-entry file="MySetTest_equals - 2018.07.01 at 14h 45m 01s.xml">
393
+      <configuration name="MySetTest.equals" configurationId="JUnit" />
394
+    </history-entry>
395
+    <history-entry file="MySetTest_equals - 2018.07.01 at 14h 49m 40s.xml">
396
+      <configuration name="MySetTest.equals" configurationId="JUnit" />
397
+    </history-entry>
398
+    <history-entry file="MySetTest - 2018.07.01 at 15h 22m 32s.xml">
399
+      <configuration name="MySetTest" configurationId="JUnit" />
400
+    </history-entry>
401
+    <history-entry file="MySetTest_hashCodeTest - 2018.07.01 at 15h 35m 21s.xml">
402
+      <configuration name="MySetTest.hashCodeTest" configurationId="JUnit" />
403
+    </history-entry>
404
+    <history-entry file="MySetTest_hashCodeTest - 2018.07.01 at 15h 36m 59s.xml">
405
+      <configuration name="MySetTest.hashCodeTest" configurationId="JUnit" />
406
+    </history-entry>
407
+    <history-entry file="MySetTest_hashCodeTest - 2018.07.01 at 15h 37m 46s.xml">
408
+      <configuration name="MySetTest.hashCodeTest" configurationId="JUnit" />
409
+    </history-entry>
410
+  </component>
411
+  <component name="TimeTrackingManager">
412
+    <option name="totallyTimeSpent" value="27134000" />
413
+  </component>
414
+  <component name="ToolWindowManager">
415
+    <frame x="-335" y="-1080" width="1920" height="1080" extended-state="0" />
416
+    <layout>
417
+      <window_info anchor="right" id="Palette" order="3" />
418
+      <window_info anchor="bottom" id="TODO" order="6" />
419
+      <window_info anchor="bottom" id="Messages" order="7" weight="0.32935324" />
420
+      <window_info anchor="right" id="Palette&#9;" order="3" />
421
+      <window_info id="Image Layers" order="2" />
422
+      <window_info anchor="right" id="Capture Analysis" order="3" />
423
+      <window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
424
+      <window_info anchor="right" id="Maven Projects" order="3" />
425
+      <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
426
+      <window_info anchor="bottom" id="Run" order="2" weight="0.3512438" />
427
+      <window_info anchor="bottom" id="Version Control" order="7" />
428
+      <window_info anchor="bottom" id="Terminal" order="7" />
429
+      <window_info id="Capture Tool" order="2" />
430
+      <window_info id="Designer" order="2" />
431
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.16666667" />
432
+      <window_info anchor="right" id="Database" order="3" />
433
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
434
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
435
+      <window_info id="UI Designer" order="2" />
436
+      <window_info anchor="right" id="Theme Preview" order="3" />
437
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
438
+      <window_info id="Favorites" order="2" side_tool="true" />
439
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
440
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
441
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
442
+      <window_info anchor="bottom" id="Message" order="0" />
443
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
444
+      <window_info anchor="bottom" id="Find" order="1" weight="0.32965517" />
445
+    </layout>
446
+  </component>
447
+  <component name="TypeScriptGeneratedFilesManager">
448
+    <option name="version" value="1" />
449
+  </component>
450
+  <component name="VcsContentAnnotationSettings">
451
+    <option name="myLimit" value="2678400000" />
452
+  </component>
453
+  <component name="XDebuggerManager">
454
+    <breakpoint-manager>
455
+      <option name="time" value="7" />
456
+    </breakpoint-manager>
457
+  </component>
458
+  <component name="editorHistoryManager">
459
+    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
460
+      <provider selected="true" editor-type-id="text-editor">
461
+        <state relative-caret-position="390">
462
+          <caret line="27" column="34" selection-start-line="27" selection-start-column="34" selection-end-line="27" selection-end-column="34" />
463
+          <folding>
464
+            <element signature="e#97#98#0" expanded="true" />
465
+            <element signature="e#131#132#0" expanded="true" />
466
+            <element signature="e#1734#1735#0" expanded="true" />
467
+            <element signature="e#1759#1760#0" expanded="true" />
468
+          </folding>
469
+        </state>
470
+      </provider>
471
+    </entry>
472
+    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
473
+      <provider selected="true" editor-type-id="text-editor">
474
+        <state relative-caret-position="555">
475
+          <caret line="42" lean-forward="true" selection-start-line="42" selection-end-line="42" />
476
+        </state>
477
+      </provider>
478
+    </entry>
479
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
480
+      <provider selected="true" editor-type-id="text-editor">
481
+        <state relative-caret-position="270">
482
+          <caret line="18" column="37" lean-forward="true" selection-start-line="18" selection-start-column="37" selection-end-line="18" selection-end-column="37" />
483
+        </state>
484
+      </provider>
485
+    </entry>
486
+    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
487
+      <provider selected="true" editor-type-id="text-editor">
488
+        <state relative-caret-position="405">
489
+          <caret line="27" column="34" selection-start-line="27" selection-start-column="34" selection-end-line="27" selection-end-column="34" />
490
+          <folding>
491
+            <element signature="e#97#98#0" expanded="true" />
492
+            <element signature="e#131#132#0" expanded="true" />
493
+            <element signature="e#1734#1735#0" expanded="true" />
494
+            <element signature="e#1759#1760#0" expanded="true" />
495
+          </folding>
496
+        </state>
497
+      </provider>
498
+    </entry>
499
+    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
500
+      <provider selected="true" editor-type-id="text-editor">
501
+        <state relative-caret-position="555">
502
+          <caret line="42" lean-forward="true" selection-start-line="42" selection-end-line="42" />
503
+        </state>
504
+      </provider>
505
+    </entry>
506
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
507
+      <provider selected="true" editor-type-id="text-editor">
508
+        <state relative-caret-position="270">
509
+          <caret line="18" column="37" lean-forward="true" selection-start-line="18" selection-start-column="37" selection-end-line="18" selection-end-column="37" />
510
+        </state>
511
+      </provider>
512
+    </entry>
513
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
514
+      <provider selected="true" editor-type-id="text-editor">
515
+        <state relative-caret-position="975">
516
+          <caret line="67" column="51" selection-start-line="67" selection-start-column="51" selection-end-line="67" selection-end-column="51" />
517
+          <folding>
518
+            <element signature="imports" expanded="true" />
519
+          </folding>
520
+        </state>
521
+      </provider>
522
+    </entry>
523
+    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
524
+      <provider selected="true" editor-type-id="text-editor">
525
+        <state relative-caret-position="30">
526
+          <caret line="6" column="24" selection-start-line="6" selection-start-column="24" selection-end-line="6" selection-end-column="24" />
527
+        </state>
528
+      </provider>
529
+    </entry>
530
+    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
531
+      <provider selected="true" editor-type-id="text-editor">
532
+        <state relative-caret-position="960">
533
+          <caret line="64" column="20" selection-start-line="64" selection-start-column="20" selection-end-line="64" selection-end-column="20" />
534
+          <folding>
535
+            <element signature="e#97#98#0" expanded="true" />
536
+            <element signature="e#131#132#0" expanded="true" />
537
+            <element signature="e#1734#1735#0" expanded="true" />
538
+            <element signature="e#1759#1760#0" expanded="true" />
539
+          </folding>
540
+        </state>
541
+      </provider>
542
+    </entry>
543
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
544
+      <provider selected="true" editor-type-id="text-editor">
545
+        <state relative-caret-position="120">
546
+          <caret line="8" column="4" selection-start-line="8" selection-start-column="4" selection-end-line="16" selection-end-column="5" />
547
+        </state>
548
+      </provider>
549
+    </entry>
550
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
551
+      <provider selected="true" editor-type-id="text-editor">
552
+        <state relative-caret-position="975">
553
+          <caret line="67" column="51" selection-start-line="67" selection-start-column="51" selection-end-line="67" selection-end-column="51" />
554
+          <folding>
555
+            <element signature="imports" expanded="true" />
556
+          </folding>
557
+        </state>
558
+      </provider>
559
+    </entry>
560
+    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
561
+      <provider selected="true" editor-type-id="text-editor">
562
+        <state relative-caret-position="30">
563
+          <caret line="6" column="24" lean-forward="true" selection-start-line="6" selection-start-column="24" selection-end-line="6" selection-end-column="24" />
564
+        </state>
565
+      </provider>
566
+    </entry>
567
+    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
568
+      <provider selected="true" editor-type-id="text-editor">
569
+        <state relative-caret-position="960">
570
+          <caret line="64" column="20" selection-start-line="64" selection-start-column="20" selection-end-line="64" selection-end-column="20" />
571
+        </state>
572
+      </provider>
573
+    </entry>
574
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
575
+      <provider selected="true" editor-type-id="text-editor">
576
+        <state relative-caret-position="120">
577
+          <caret line="8" column="4" selection-start-line="8" selection-start-column="4" selection-end-line="16" selection-end-column="5" />
578
+        </state>
579
+      </provider>
580
+    </entry>
581
+    <entry file="file://$PROJECT_DIR$/src/main/java/ArrayList.java" />
582
+    <entry file="file://$PROJECT_DIR$/src/test/java/MyArrayListTest.java">
583
+      <provider selected="true" editor-type-id="text-editor">
584
+        <state relative-caret-position="1005">
585
+          <caret line="67" column="51" selection-start-line="67" selection-start-column="51" selection-end-line="67" selection-end-column="51" />
586
+          <folding>
587
+            <element signature="imports" expanded="true" />
588
+          </folding>
589
+        </state>
590
+      </provider>
591
+    </entry>
592
+    <entry file="file://$PROJECT_DIR$/README.md">
593
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
594
+        <state split_layout="SPLIT">
595
+          <first_editor />
596
+          <second_editor />
597
+        </state>
598
+      </provider>
599
+    </entry>
600
+    <entry file="file://$PROJECT_DIR$/src/main/java/MyArrayList.java">
601
+      <provider selected="true" editor-type-id="text-editor">
602
+        <state relative-caret-position="166">
603
+          <caret line="37" column="13" lean-forward="true" selection-start-line="37" selection-start-column="13" selection-end-line="37" selection-end-column="13" />
604
+        </state>
605
+      </provider>
606
+    </entry>
607
+    <entry file="file://$PROJECT_DIR$/src/main/java/MySet.java">
608
+      <provider selected="true" editor-type-id="text-editor">
609
+        <state relative-caret-position="301">
610
+          <caret line="84" column="30" selection-start-line="84" selection-start-column="30" selection-end-line="84" selection-end-column="30" />
611
+          <folding>
612
+            <element signature="e#97#98#0" expanded="true" />
613
+            <element signature="e#131#132#0" expanded="true" />
614
+            <element signature="e#1734#1735#0" expanded="true" />
615
+            <element signature="e#1759#1760#0" expanded="true" />
616
+          </folding>
617
+        </state>
618
+      </provider>
619
+    </entry>
620
+    <entry file="file://$PROJECT_DIR$/src/test/java/MySetTest.java">
621
+      <provider selected="true" editor-type-id="text-editor">
622
+        <state relative-caret-position="538">
623
+          <caret line="144" lean-forward="true" selection-start-line="144" selection-end-line="144" />
624
+        </state>
625
+      </provider>
626
+    </entry>
627
+  </component>
628
+  <component name="masterDetails">
629
+    <states>
630
+      <state key="ArtifactsStructureConfigurable.UI">
631
+        <settings>
632
+          <artifact-editor />
633
+          <splitter-proportions>
634
+            <option name="proportions">
635
+              <list>
636
+                <option value="0.2" />
637
+              </list>
638
+            </option>
639
+          </splitter-proportions>
640
+        </settings>
641
+      </state>
642
+      <state key="FacetStructureConfigurable.UI">
643
+        <settings>
644
+          <last-edited>No facets are configured</last-edited>
645
+          <splitter-proportions>
646
+            <option name="proportions">
647
+              <list>
648
+                <option value="0.2" />
649
+              </list>
650
+            </option>
651
+          </splitter-proportions>
652
+        </settings>
653
+      </state>
654
+      <state key="GlobalLibrariesConfigurable.UI">
655
+        <settings>
656
+          <splitter-proportions>
657
+            <option name="proportions">
658
+              <list>
659
+                <option value="0.2" />
660
+              </list>
661
+            </option>
662
+          </splitter-proportions>
663
+        </settings>
664
+      </state>
665
+      <state key="JdkListConfigurable.UI">
666
+        <settings>
667
+          <last-edited>1.8</last-edited>
668
+          <splitter-proportions>
669
+            <option name="proportions">
670
+              <list>
671
+                <option value="0.2" />
672
+              </list>
673
+            </option>
674
+          </splitter-proportions>
675
+        </settings>
676
+      </state>
677
+      <state key="ModuleStructureConfigurable.UI">
678
+        <settings>
679
+          <last-edited>generics</last-edited>
680
+          <splitter-proportions>
681
+            <option name="proportions">
682
+              <list>
683
+                <option value="0.2" />
684
+                <option value="0.6" />
685
+              </list>
686
+            </option>
687
+          </splitter-proportions>
688
+        </settings>
689
+      </state>
690
+      <state key="ProjectJDKs.UI">
691
+        <settings>
692
+          <last-edited>1.8</last-edited>
693
+          <splitter-proportions>
694
+            <option name="proportions">
695
+              <list>
696
+                <option value="0.2" />
697
+              </list>
698
+            </option>
699
+          </splitter-proportions>
700
+        </settings>
701
+      </state>
702
+      <state key="ProjectLibrariesConfigurable.UI">
703
+        <settings>
704
+          <last-edited>Maven: junit:junit:4.12</last-edited>
705
+          <splitter-proportions>
706
+            <option name="proportions">
707
+              <list>
708
+                <option value="0.2" />
709
+              </list>
710
+            </option>
711
+          </splitter-proportions>
712
+        </settings>
713
+      </state>
714
+    </states>
715
+  </component>
716
+</project>

+ 16
- 0
generics.iml Wyświetl plik

@@ -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 Wyświetl plik


+ 86
- 0
src/main/java/MyArrayList.java Wyświetl plik

@@ -0,0 +1,86 @@
1
+import java.util.ArrayList;
2
+
3
+public class MyArrayList<E> {
4
+
5
+    private int size;     // number of elements
6
+    private Object[] elements;
7
+    private Object[] tempArray;
8
+
9
+    public MyArrayList() {         // constructor
10
+        elements = new Object[0];  // allocate initial capacity of 0
11
+        size = 0;
12
+    }
13
+
14
+    public MyArrayList(int num) {
15
+        elements = new Object[num];  // allocate initial capacity of num
16
+        size = 0;
17
+    }
18
+
19
+    public void add(E e) {
20
+        if (size < elements.length) {
21
+            elements[size] = e;
22
+        } else {
23
+            tempArray = new Object[elements.length + 1];
24
+            for (int i = 0; i < elements.length; i++) {
25
+                tempArray[i] = elements[i];
26
+            }
27
+            tempArray[tempArray.length - 1] = e;
28
+            elements = tempArray;
29
+        }
30
+        size++;
31
+    }
32
+
33
+    public boolean contains(E e) {
34
+        boolean returnThis = false;
35
+        for (Object object : elements) {
36
+            if (object.equals(e)) {
37
+                returnThis = true;
38
+            }
39
+        }
40
+        return returnThis;
41
+    }
42
+
43
+    public E get(int index) {
44
+        if (index >= size)
45
+            throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
46
+        return (E) elements[index];
47
+    }
48
+
49
+    public int size() {
50
+        return size;
51
+    }
52
+
53
+    public void clear() {
54
+        elements = new Object[0];
55
+        size = 0;
56
+    }
57
+
58
+    public boolean isEmpty() {
59
+        if (elements.length == 0) {
60
+            return true;
61
+        } else return false;
62
+    }
63
+
64
+    public void remove(E e) {
65
+        tempArray = new Object[elements.length - 1];
66
+        int j = 0;
67
+        for (int i = 0; i < elements.length; i++) {
68
+            if (elements[i] != e) {
69
+                tempArray[j] = elements[i];
70
+                j++;
71
+            }
72
+        }
73
+        elements = tempArray;
74
+        size--;
75
+    }
76
+
77
+    public void set(int index, E e) {
78
+        elements[index] = e;
79
+
80
+
81
+    }
82
+
83
+}
84
+
85
+
86
+

+ 110
- 0
src/main/java/MySet.java Wyświetl plik

@@ -0,0 +1,110 @@
1
+import java.util.*;
2
+
3
+public class MySet<E> {
4
+
5
+    private E[] set;
6
+
7
+    public MySet(E[] array){
8
+        this.set = array;
9
+    }
10
+
11
+
12
+    public boolean add(E value) {
13
+        boolean add = false;
14
+        E[] arr = Arrays.copyOf(this.set,this.set.length+1);
15
+        int count = 0;
16
+        for (int i = 0; i <set.length ; i++) {
17
+            if(set[i] == value){
18
+                add = false;
19
+            }
20
+            else if(set[i] != value){
21
+                arr[count] = set[i];
22
+                count++;
23
+                add = true;
24
+            }
25
+        }
26
+        return add;
27
+    }
28
+
29
+
30
+    public boolean addAll(Long[] array2merge) {
31
+
32
+        boolean add = false;
33
+        E[] arr = Arrays.copyOf(this.set,this.set.length+array2merge.length);
34
+        int count = 0;
35
+        for (int i = 0; i <set.length ; i++) {
36
+            if(set[i] == array2merge[i]){
37
+                add = false;
38
+            }
39
+            else{
40
+                add = true;
41
+                arr[count] = set[i];
42
+                count++;
43
+
44
+            }
45
+        }
46
+        return add;
47
+    }
48
+
49
+    public E[] clear() {
50
+        E[] arr = Arrays.copyOf(this.set,0);
51
+
52
+        return arr;
53
+    }
54
+
55
+    public boolean contains(E value) {
56
+        boolean bool = false;
57
+        for (E s: set) {
58
+            if (s.equals(value)){
59
+                bool = true;
60
+            }
61
+        }
62
+        return bool;
63
+    }
64
+
65
+
66
+    public boolean equal(E value) {
67
+        boolean bool = false;
68
+        for(int i = 0; i<set.length; i++){
69
+            if(set[i] == value){
70
+                bool = true;
71
+            }
72
+        }
73
+        return bool;
74
+    }
75
+
76
+    public boolean isEmpty() {
77
+        if(set.length == 0){
78
+            return true;
79
+        }
80
+        return false;
81
+    }
82
+
83
+
84
+    public int hashCode() {
85
+        return set.hashCode();
86
+    }
87
+
88
+    public int size() {
89
+        int size = set.length;
90
+
91
+        return size;
92
+
93
+    }
94
+
95
+    public boolean remove(int index) {
96
+        E removed = set[index];
97
+        E[] arr = Arrays.copyOf(this.set,this.set.length-1);
98
+        int count = 0;
99
+        for(int i = 0; i < set.length; i++){
100
+            if(i != index){
101
+                arr[count] = set[i];
102
+                count++;
103
+            }
104
+        }
105
+        set = arr;
106
+       return !this.contains(removed);
107
+    }
108
+}
109
+
110
+

+ 0
- 0
src/test/java/.deleteme Wyświetl plik


+ 78
- 0
src/test/java/MyArrayListTest.java Wyświetl plik

@@ -0,0 +1,78 @@
1
+import org.junit.Test;
2
+
3
+import static org.junit.Assert.assertTrue;
4
+
5
+public class MyArrayListTest {
6
+
7
+    @Test
8
+    public void addAndContainsTest(){
9
+        MyArrayList<Integer> test = new MyArrayList<>();
10
+        test.add(5);
11
+        assertTrue(test.contains(5));
12
+    }
13
+
14
+    @Test
15
+    public void getTest(){
16
+        MyArrayList<Integer> test = new MyArrayList<>();
17
+        test.add(5);
18
+        test.add(6);
19
+        test.add(7);
20
+        test.add(8);
21
+
22
+        assertTrue(test.get(2).equals(7));
23
+    }
24
+
25
+    @Test
26
+    public void sizeTest(){
27
+        MyArrayList<Integer> test = new MyArrayList<>();
28
+        test.add(5);
29
+        test.add(6);
30
+        test.add(7);
31
+        test.add(8);
32
+
33
+        assertTrue(test.size() == 4);
34
+    }
35
+
36
+    @Test
37
+    public void clearTest(){
38
+        MyArrayList<Integer> test = new MyArrayList<>();
39
+        test.add(5);
40
+        test.add(6);
41
+        test.add(7);
42
+        test.add(8);
43
+        test.clear();
44
+
45
+        assertTrue(test.size() == 0);
46
+    }
47
+
48
+    @Test
49
+    public void isEmptyTest(){
50
+        MyArrayList<Integer> test = new MyArrayList<>();
51
+        assertTrue(test.isEmpty());
52
+    }
53
+
54
+    @Test
55
+    public void removeTest(){
56
+        MyArrayList<Integer> test = new MyArrayList<>();
57
+        test.add(5);
58
+        test.add(6);
59
+        test.add(7);
60
+        test.add(8);
61
+        test.remove(7);
62
+
63
+        assertTrue(!test.contains(7));
64
+    }
65
+
66
+    @Test
67
+    public void setTest(){
68
+        MyArrayList<String> test = new MyArrayList<>();
69
+        test.add("abc");
70
+        test.add("def");
71
+        test.add("ghi");
72
+        test.add("jkl");
73
+        test.set(2,"mno");
74
+
75
+        assertTrue(!test.contains("ghi"));
76
+        assertTrue(test.contains("mno"));
77
+    }
78
+}

+ 167
- 0
src/test/java/MySetTest.java Wyświetl plik

@@ -0,0 +1,167 @@
1
+import org.junit.Test;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Collection;
5
+
6
+import static org.junit.Assert.*;
7
+
8
+public class MySetTest {
9
+
10
+    @Test
11
+    public void testAdd(){
12
+        Integer value = 3;
13
+        Integer[] array = {1,2};
14
+        MySet<Integer> arr = new MySet<>(array);
15
+
16
+        Integer[] expected = {1,2,value};
17
+        boolean actual = arr.add(value);
18
+
19
+        assertTrue(actual);
20
+    }
21
+    @Test
22
+    public void testAddContainsAlready(){
23
+
24
+        Integer value = 3;
25
+        Integer[] array = {1,2,value};
26
+
27
+        MySet<Integer> arr = new MySet<>(array);
28
+
29
+        //Integer[] expected = {1,2,3};
30
+        boolean actual = arr.add(value);
31
+
32
+        assertFalse(actual);
33
+    }
34
+
35
+    @Test
36
+    public void testAddAll(){
37
+        Long[] array = {};
38
+        Long[] array2merge = {3L,4L};
39
+
40
+        MySet<Long> arr = new MySet<>(array);
41
+
42
+        boolean actual = arr.addAll(array2merge);
43
+
44
+        assertFalse(actual);
45
+
46
+    }
47
+
48
+    @Test
49
+    public void testAddAllContainsAlready(){
50
+        Long[] array = {1L,2L,3L,4L};
51
+        Long[] array2merge = {1L,2L,3L,4L};
52
+
53
+        MySet<Long> arr = new MySet<>(array);
54
+
55
+        boolean actual = arr.addAll(array2merge);
56
+
57
+        assertFalse(actual);
58
+
59
+    }
60
+
61
+
62
+    @Test
63
+    public void clearTest(){
64
+        Integer[] array = {1,552,2456,63654};
65
+        Integer[] expected = {};
66
+        MySet<Integer> arr = new MySet<>(array);
67
+        Integer[] actual = arr.clear();
68
+
69
+        assertArrayEquals(expected,actual);
70
+
71
+    }
72
+
73
+    @Test
74
+    public void containsTest(){
75
+        String value = "a";
76
+        String[] array = {"b", value, "e"};
77
+        MySet<String> arr = new MySet<>(array);
78
+
79
+        //String expected = "a";
80
+        boolean actual = arr.contains(value);
81
+
82
+        assertTrue(actual);
83
+
84
+    }
85
+    @Test
86
+    public void doesnotContain(){
87
+        int value = 3;
88
+        Integer[] array = {1,2,5};
89
+        MySet<Integer> arr = new MySet<>(array);
90
+
91
+        boolean actual = arr.contains(value);
92
+        assertFalse(actual);
93
+
94
+    }
95
+
96
+    @Test
97
+    public void equal(){
98
+        Integer value = 3;
99
+        Integer[] array = {value,4,value,5,6};
100
+        MySet<Integer> arr = new MySet<>(array);
101
+
102
+        boolean actual = arr.equal(value);
103
+        assertTrue(actual);
104
+
105
+    }
106
+    @Test
107
+    public void notEqual(){
108
+
109
+        Integer value = 3;
110
+        Integer[] array = {2,4,6};
111
+        MySet<Integer> arr = new MySet<>(array);
112
+
113
+        boolean actual = arr.equal(value);
114
+        assertFalse(actual);
115
+    }
116
+
117
+    @Test
118
+    public void isEmptyTest(){
119
+        Object[] array = {};
120
+        MySet<Object> arr = new MySet<>(array);
121
+
122
+        boolean actual = arr.isEmpty();
123
+
124
+        assertTrue(actual);
125
+    }
126
+    @Test
127
+    public void isNoEmptyTest(){
128
+        Object[] array = {3,4,"a"};
129
+        MySet<Object> arr = new MySet<>(array);
130
+
131
+        boolean actual = arr.isEmpty();
132
+
133
+        assertFalse(actual);
134
+    }
135
+
136
+    @Test
137
+    public void hashCodeTest(){
138
+        Integer[] array = {1,2,3};
139
+        MySet<Integer> arr = new MySet<>(array);
140
+
141
+        int expected = array.hashCode();
142
+        int actual = arr.hashCode();
143
+
144
+        assertEquals(expected,actual);
145
+
146
+    }
147
+    @Test
148
+    public void testSize(){
149
+        Integer[] array = {1,2,3};
150
+        MySet<Integer> arr = new MySet<>(array);
151
+
152
+        int expected = 3;
153
+        int actual = arr.size();
154
+
155
+        assertEquals(expected,actual);
156
+    }
157
+    @Test
158
+    public void testRemove(){
159
+        Integer value = 110;
160
+        int index = 0;
161
+        Integer[] array = {3, value};
162
+        MySet<Integer> arr = new MySet<>(array);
163
+
164
+        assertTrue(arr.remove(index));
165
+
166
+    }
167
+}