Parcourir la source

Completed 95% of lab with 100% test coverage

William Brown il y a 6 ans
Parent
révision
6d38f03b65

+ 0
- 13
.idea/libraries/Maven__junit_junit_4_0.xml Voir le fichier

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

+ 13
- 0
.idea/libraries/Maven__junit_junit_4_12.xml Voir le fichier

@@ -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 Voir le fichier

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

+ 173
- 54
.idea/workspace.xml Voir le fichier

@@ -2,15 +2,12 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="3455511b-a100-4bbd-b07c-68f009bc8dbc" name="Default" comment="">
5
-      <change afterPath="$PROJECT_DIR$/arraz/.idea/compiler.xml" afterDir="false" />
6
-      <change afterPath="$PROJECT_DIR$/arraz/.idea/libraries/Maven__junit_junit_4_0.xml" afterDir="false" />
7
-      <change afterPath="$PROJECT_DIR$/arraz/.idea/misc.xml" afterDir="false" />
8
-      <change afterPath="$PROJECT_DIR$/arraz/.idea/modules.xml" afterDir="false" />
9
-      <change afterPath="$PROJECT_DIR$/arraz/.idea/vcs.xml" afterDir="false" />
10
-      <change afterPath="$PROJECT_DIR$/arraz/.idea/workspace.xml" afterDir="false" />
11
-      <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
5
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_0.xml" beforeDir="false" />
12 8
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
13 9
       <change beforePath="$PROJECT_DIR$/arraz/arraz.iml" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/arraz.iml" afterDir="false" />
10
+      <change beforePath="$PROJECT_DIR$/arraz/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/pom.xml" afterDir="false" />
14 11
       <change beforePath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" afterDir="false" />
15 12
       <change beforePath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" afterDir="false" />
16 13
     </list>
@@ -21,18 +18,36 @@
21 18
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
22 19
     <option name="LAST_RESOLUTION" value="IGNORE" />
23 20
   </component>
21
+  <component name="CoverageDataManager">
22
+    <SUITE FILE_PATH="coverage/ArraysGoneWild$ArrazTest_testCheck2ArraysForEqual3.ic" NAME="ArrazTest.testCheck2ArraysForEqual3 Coverage Results" MODIFIED="1544144487539" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
23
+    <SUITE FILE_PATH="coverage/ArraysGoneWild$ArrazTest_testRemoveElementFromArray3.ic" NAME="ArrazTest.testRemoveElementFromArray3 Coverage Results" MODIFIED="1544144601050" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
24
+    <SUITE FILE_PATH="coverage/ArraysGoneWild$ArrazTest.ic" NAME="ArrazTest Coverage Results" MODIFIED="1544144398898" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
25
+    <SUITE FILE_PATH="coverage/ArraysGoneWild$ArrazTest_testFindIndexOf2.ic" NAME="ArrazTest.testFindIndexOf2 Coverage Results" MODIFIED="1544144634293" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
26
+  </component>
27
+  <component name="CoverageViewManager">
28
+    <option name="myElementSize" value="154" />
29
+  </component>
24 30
   <component name="FUSProjectUsageTrigger">
25 31
     <session id="-1803996711">
26 32
       <usages-collector id="statistics.lifecycle.project">
27 33
         <counts>
28
-          <entry key="project.closed" value="1" />
34
+          <entry key="project.closed" value="4" />
35
+          <entry key="project.open.time.14" value="2" />
36
+          <entry key="project.open.time.2" value="1" />
29 37
           <entry key="project.open.time.4" value="2" />
30
-          <entry key="project.opened" value="2" />
38
+          <entry key="project.opened" value="5" />
31 39
         </counts>
32 40
       </usages-collector>
33 41
       <usages-collector id="statistics.file.types.edit">
34 42
         <counts>
35
-          <entry key="JAVA" value="526" />
43
+          <entry key="JAVA" value="9727" />
44
+          <entry key="XML" value="4" />
45
+        </counts>
46
+      </usages-collector>
47
+      <usages-collector id="statistics.file.types.open">
48
+        <counts>
49
+          <entry key="JAVA" value="1" />
50
+          <entry key="XML" value="1" />
36 51
         </counts>
37 52
       </usages-collector>
38 53
     </session>
@@ -42,13 +57,18 @@
42 57
       <file pinned="false" current-in-tab="false">
43 58
         <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
44 59
           <provider selected="true" editor-type-id="text-editor">
45
-            <state relative-caret-position="164">
46
-              <caret line="30" column="54" selection-start-line="30" selection-start-column="54" selection-end-line="30" selection-end-column="54" />
60
+            <state relative-caret-position="280">
61
+              <caret line="81" column="20" selection-start-line="81" selection-start-column="20" selection-end-line="81" selection-end-column="20" />
47 62
               <folding>
48
-                <element signature="e#470#471#0" expanded="true" />
49
-                <element signature="e#527#528#0" expanded="true" />
50
-                <element signature="e#589#590#0" expanded="true" />
51
-                <element signature="e#646#647#0" expanded="true" />
63
+                <element signature="imports" expanded="true" />
64
+                <element signature="e#504#505#0" expanded="true" />
65
+                <element signature="e#561#562#0" expanded="true" />
66
+                <element signature="e#616#617#0" expanded="true" />
67
+                <element signature="e#674#675#0" expanded="true" />
68
+                <element signature="e#1783#1784#0" expanded="true" />
69
+                <element signature="e#1810#1811#0" expanded="true" />
70
+                <element signature="e#4880#4881#0" expanded="true" />
71
+                <element signature="e#4918#4919#0" expanded="true" />
52 72
               </folding>
53 73
             </state>
54 74
           </provider>
@@ -57,10 +77,12 @@
57 77
       <file pinned="false" current-in-tab="true">
58 78
         <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
59 79
           <provider selected="true" editor-type-id="text-editor">
60
-            <state relative-caret-position="375">
61
-              <caret line="25" column="25" selection-start-line="25" selection-start-column="25" selection-end-line="25" selection-end-column="25" />
80
+            <state relative-caret-position="386">
81
+              <caret line="203" lean-forward="true" selection-start-line="203" selection-end-line="203" />
62 82
               <folding>
63 83
                 <element signature="imports" expanded="true" />
84
+                <element signature="e#8537#8546#0" expanded="true" />
85
+                <element signature="e#8823#8832#0" expanded="true" />
64 86
               </folding>
65 87
             </state>
66 88
           </provider>
@@ -76,6 +98,20 @@
76 98
       </list>
77 99
     </option>
78 100
   </component>
101
+  <component name="FindInProjectRecents">
102
+    <findStrings>
103
+      <find>public</find>
104
+      <find>Arraz.</find>
105
+      <find>equal</find>
106
+      <find>remove</find>
107
+      <find>findindex</find>
108
+      <find>copy</find>
109
+    </findStrings>
110
+    <replaceStrings>
111
+      <replace>public</replace>
112
+      <replace>arraz.</replace>
113
+    </replaceStrings>
114
+  </component>
79 115
   <component name="Git.Settings">
80 116
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
81 117
   </component>
@@ -90,6 +126,7 @@
90 126
     <option name="CHANGED_PATHS">
91 127
       <list>
92 128
         <option value="$PROJECT_DIR$/README.md" />
129
+        <option value="$PROJECT_DIR$/arraz/pom.xml" />
93 130
         <option value="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" />
94 131
         <option value="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" />
95 132
       </list>
@@ -118,6 +155,8 @@
118 155
       <foldersAlwaysOnTop value="true" />
119 156
     </navigator>
120 157
     <panes>
158
+      <pane id="Scope" />
159
+      <pane id="PackagesPane" />
121 160
       <pane id="ProjectPane">
122 161
         <subPane>
123 162
           <expand>
@@ -146,21 +185,42 @@
146 185
             <path>
147 186
               <item name="ArraysGoneWild" type="b2602c69:ProjectViewProjectNode" />
148 187
               <item name="ArraysGoneWild" type="462c0819:PsiDirectoryNode" />
188
+              <item name="arraz" type="462c0819:PsiDirectoryNode" />
189
+              <item name="src" type="462c0819:PsiDirectoryNode" />
190
+              <item name="main" type="462c0819:PsiDirectoryNode" />
191
+              <item name="java" type="462c0819:PsiDirectoryNode" />
192
+            </path>
193
+            <path>
194
+              <item name="ArraysGoneWild" type="b2602c69:ProjectViewProjectNode" />
195
+              <item name="ArraysGoneWild" type="462c0819:PsiDirectoryNode" />
196
+              <item name="arraz" type="462c0819:PsiDirectoryNode" />
197
+              <item name="src" type="462c0819:PsiDirectoryNode" />
198
+              <item name="test" type="462c0819:PsiDirectoryNode" />
199
+            </path>
200
+            <path>
201
+              <item name="ArraysGoneWild" type="b2602c69:ProjectViewProjectNode" />
202
+              <item name="ArraysGoneWild" type="462c0819:PsiDirectoryNode" />
203
+              <item name="arraz" type="462c0819:PsiDirectoryNode" />
204
+              <item name="src" type="462c0819:PsiDirectoryNode" />
205
+              <item name="test" type="462c0819:PsiDirectoryNode" />
206
+              <item name="java" type="462c0819:PsiDirectoryNode" />
207
+            </path>
208
+            <path>
209
+              <item name="ArraysGoneWild" type="b2602c69:ProjectViewProjectNode" />
210
+              <item name="ArraysGoneWild" type="462c0819:PsiDirectoryNode" />
149 211
               <item name="DocumentationOnArrays" type="462c0819:PsiDirectoryNode" />
150 212
             </path>
151 213
           </expand>
152 214
           <select />
153 215
         </subPane>
154 216
       </pane>
155
-      <pane id="Scope" />
156
-      <pane id="PackagesPane" />
157 217
     </panes>
158 218
   </component>
159 219
   <component name="PropertiesComponent">
160 220
     <property name="GO_FMT" value="false" />
161 221
     <property name="WebServerToolWindowFactoryState" value="false" />
162 222
     <property name="aspect.path.notification.shown" value="true" />
163
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544046882578" />
223
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544144681387" />
164 224
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
165 225
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
166 226
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
@@ -187,7 +247,7 @@
187 247
       </list>
188 248
     </option>
189 249
   </component>
190
-  <component name="RunManager" selected="JUnit.ArrazTest">
250
+  <component name="RunManager" selected="JUnit.ArrazTest.testFindIndexOf2">
191 251
     <configuration default="true" type="Applet" factoryName="Applet">
192 252
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
193 253
       <method v="2">
@@ -209,22 +269,44 @@
209 269
         <option name="Make" enabled="true" />
210 270
       </method>
211 271
     </configuration>
212
-    <configuration name="ArrazTest.testAverageOfArray2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
272
+    <configuration name="ArrazTest.testCheck2ArraysForEqual3" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
213 273
       <module name="arraz" />
214 274
       <option name="PACKAGE_NAME" value="" />
215 275
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
216
-      <option name="METHOD_NAME" value="testAverageOfArray2" />
276
+      <option name="METHOD_NAME" value="testCheck2ArraysForEqual3" />
217 277
       <option name="TEST_OBJECT" value="method" />
218 278
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
219 279
       <method v="2">
220 280
         <option name="Make" enabled="true" />
221 281
       </method>
222 282
     </configuration>
223
-    <configuration name="ArrazTest.testDoubleAverageOfArray" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
283
+    <configuration name="ArrazTest.testFindIndexOf2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
224 284
       <module name="arraz" />
225 285
       <option name="PACKAGE_NAME" value="" />
226 286
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
227
-      <option name="METHOD_NAME" value="testDoubleAverageOfArray" />
287
+      <option name="METHOD_NAME" value="testFindIndexOf2" />
288
+      <option name="TEST_OBJECT" value="method" />
289
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
290
+      <method v="2">
291
+        <option name="Make" enabled="true" />
292
+      </method>
293
+    </configuration>
294
+    <configuration name="ArrazTest.testRemoveElementFromArray3" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
295
+      <module name="arraz" />
296
+      <option name="PACKAGE_NAME" value="" />
297
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
298
+      <option name="METHOD_NAME" value="testRemoveElementFromArray3" />
299
+      <option name="TEST_OBJECT" value="method" />
300
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
301
+      <method v="2">
302
+        <option name="Make" enabled="true" />
303
+      </method>
304
+    </configuration>
305
+    <configuration name="ArrazTest.testSumValuesOfArrayPostive" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
306
+      <module name="arraz" />
307
+      <option name="PACKAGE_NAME" value="" />
308
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
309
+      <option name="METHOD_NAME" value="testSumValuesOfArrayPostive" />
228 310
       <option name="TEST_OBJECT" value="method" />
229 311
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
230 312
       <method v="2">
@@ -255,15 +337,19 @@
255 337
       </method>
256 338
     </configuration>
257 339
     <list>
258
-      <item itemvalue="JUnit.ArrazTest.testDoubleAverageOfArray" />
259 340
       <item itemvalue="JUnit.ArrazTest" />
260
-      <item itemvalue="JUnit.ArrazTest.testAverageOfArray2" />
341
+      <item itemvalue="JUnit.ArrazTest.testSumValuesOfArrayPostive" />
342
+      <item itemvalue="JUnit.ArrazTest.testCheck2ArraysForEqual3" />
343
+      <item itemvalue="JUnit.ArrazTest.testRemoveElementFromArray3" />
344
+      <item itemvalue="JUnit.ArrazTest.testFindIndexOf2" />
261 345
     </list>
262 346
     <recent_temporary>
263 347
       <list>
348
+        <item itemvalue="JUnit.ArrazTest.testFindIndexOf2" />
349
+        <item itemvalue="JUnit.ArrazTest.testRemoveElementFromArray3" />
350
+        <item itemvalue="JUnit.ArrazTest.testCheck2ArraysForEqual3" />
264 351
         <item itemvalue="JUnit.ArrazTest" />
265
-        <item itemvalue="JUnit.ArrazTest.testAverageOfArray2" />
266
-        <item itemvalue="JUnit.ArrazTest.testDoubleAverageOfArray" />
352
+        <item itemvalue="JUnit.ArrazTest.testSumValuesOfArrayPostive" />
267 353
       </list>
268 354
     </recent_temporary>
269 355
   </component>
@@ -281,7 +367,10 @@
281 367
       <workItem from="1543958998826" duration="113000" />
282 368
       <workItem from="1544020724645" duration="762000" />
283 369
       <workItem from="1544027782634" duration="200000" />
284
-      <workItem from="1544045942928" duration="881000" />
370
+      <workItem from="1544045942928" duration="2151000" />
371
+      <workItem from="1544048104554" duration="1398000" />
372
+      <workItem from="1544060926907" duration="4177000" />
373
+      <workItem from="1544125434968" duration="10376000" />
285 374
     </task>
286 375
     <task id="LOCAL-00001" summary="readme and docs">
287 376
       <created>1544021313039</created>
@@ -294,38 +383,55 @@
294 383
     <servers />
295 384
   </component>
296 385
   <component name="TestHistory">
297
-    <history-entry file="ArrazTest_testDoubleAverageOfArray - 2018.12.05 at 16h 42m 22s.xml">
298
-      <configuration name="ArrazTest.testDoubleAverageOfArray" configurationId="JUnit" />
386
+    <history-entry file="ArrazTest_testSortArrayIntoEvensThenOdds2 - 2018.12.06 at 19h 44m 17s.xml">
387
+      <configuration name="ArrazTest.testSortArrayIntoEvensThenOdds2" configurationId="JUnit" />
299 388
     </history-entry>
300
-    <history-entry file="ArrazTest - 2018.12.05 at 16h 50m 15s.xml">
389
+    <history-entry file="ArrazTest - 2018.12.06 at 19h 44m 27s.xml">
301 390
       <configuration name="ArrazTest" configurationId="JUnit" />
302 391
     </history-entry>
303
-    <history-entry file="ArrazTest_testAverageOfArray2 - 2018.12.05 at 16h 51m 27s.xml">
304
-      <configuration name="ArrazTest.testAverageOfArray2" configurationId="JUnit" />
392
+    <history-entry file="ArrazTest_testSumValuesOfArrayPostive - 2018.12.06 at 19h 45m 11s.xml">
393
+      <configuration name="ArrazTest.testSumValuesOfArrayPostive" configurationId="JUnit" />
305 394
     </history-entry>
306
-    <history-entry file="ArrazTest - 2018.12.05 at 16h 52m 29s.xml">
395
+    <history-entry file="ArrazTest - 2018.12.06 at 19h 59m 51s.xml">
307 396
       <configuration name="ArrazTest" configurationId="JUnit" />
308 397
     </history-entry>
398
+    <history-entry file="ArrazTest - 2018.12.06 at 20h 00m 03s.xml">
399
+      <configuration name="ArrazTest" configurationId="JUnit" />
400
+    </history-entry>
401
+    <history-entry file="ArrazTest_testCheck2ArraysForEqual3 - 2018.12.06 at 20h 01m 22s.xml">
402
+      <configuration name="ArrazTest.testCheck2ArraysForEqual3" configurationId="JUnit" />
403
+    </history-entry>
404
+    <history-entry file="ArrazTest_testCheck2ArraysForEqual3 - 2018.12.06 at 20h 01m 30s.xml">
405
+      <configuration name="ArrazTest.testCheck2ArraysForEqual3" configurationId="JUnit" />
406
+    </history-entry>
407
+    <history-entry file="ArrazTest_testRemoveElementFromArray3 - 2018.12.06 at 20h 02m 44s.xml">
408
+      <configuration name="ArrazTest.testRemoveElementFromArray3" configurationId="JUnit" />
409
+    </history-entry>
410
+    <history-entry file="ArrazTest_testRemoveElementFromArray3 - 2018.12.06 at 20h 03m 24s.xml">
411
+      <configuration name="ArrazTest.testRemoveElementFromArray3" configurationId="JUnit" />
412
+    </history-entry>
413
+    <history-entry file="ArrazTest_testFindIndexOf2 - 2018.12.06 at 20h 03m 57s.xml">
414
+      <configuration name="ArrazTest.testFindIndexOf2" configurationId="JUnit" />
415
+    </history-entry>
309 416
   </component>
310 417
   <component name="TimeTrackingManager">
311
-    <option name="totallyTimeSpent" value="4303000" />
418
+    <option name="totallyTimeSpent" value="21524000" />
312 419
   </component>
313 420
   <component name="ToolWindowManager">
314
-    <frame x="0" y="22" width="1280" height="739" extended-state="6" />
421
+    <frame x="0" y="22" width="1280" height="739" extended-state="0" />
315 422
     <editor active="true" />
316 423
     <layout>
317
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2657512" />
424
+      <window_info content_ui="combo" id="Project" order="0" weight="0.27786753" />
318 425
       <window_info id="Structure" order="1" weight="0.25" />
319 426
       <window_info id="Image Layers" order="2" />
320 427
       <window_info id="Designer" order="3" />
321 428
       <window_info id="UI Designer" order="4" />
322 429
       <window_info id="Capture Tool" order="5" />
323 430
       <window_info id="Favorites" order="6" side_tool="true" />
324
-      <window_info anchor="bottom" id="Messages" weight="0.32921174" />
325 431
       <window_info anchor="bottom" id="Message" order="0" />
326 432
       <window_info anchor="bottom" id="Find" order="1" />
327
-      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.32921174" />
328
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
433
+      <window_info anchor="bottom" id="Run" order="2" weight="0.48377126" />
434
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.61205566" />
329 435
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
330 436
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
331 437
       <window_info anchor="bottom" id="TODO" order="6" />
@@ -333,6 +439,8 @@
333 439
       <window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
334 440
       <window_info anchor="bottom" id="Version Control" order="9" />
335 441
       <window_info anchor="bottom" id="Database Changes" order="10" show_stripe_button="false" />
442
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32921174" />
443
+      <window_info anchor="right" id="Coverage" side_tool="true" weight="0.32956383" />
336 444
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
337 445
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
338 446
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -355,9 +463,6 @@
355 463
     <option name="LAST_COMMIT_MESSAGE" value="readme and docs" />
356 464
   </component>
357 465
   <component name="editorHistoryManager">
358
-    <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
359
-      <provider selected="true" editor-type-id="text-editor" />
360
-    </entry>
361 466
     <entry file="file://$PROJECT_DIR$/README.md">
362 467
       <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
363 468
         <state split_layout="SPLIT">
@@ -368,25 +473,39 @@
368 473
         </state>
369 474
       </provider>
370 475
     </entry>
476
+    <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
477
+      <provider selected="true" editor-type-id="text-editor">
478
+        <state relative-caret-position="240">
479
+          <caret line="16" selection-start-line="16" selection-end-line="16" />
480
+        </state>
481
+      </provider>
482
+    </entry>
371 483
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
372 484
       <provider selected="true" editor-type-id="text-editor">
373
-        <state relative-caret-position="164">
374
-          <caret line="30" column="54" selection-start-line="30" selection-start-column="54" selection-end-line="30" selection-end-column="54" />
485
+        <state relative-caret-position="280">
486
+          <caret line="81" column="20" selection-start-line="81" selection-start-column="20" selection-end-line="81" selection-end-column="20" />
375 487
           <folding>
376
-            <element signature="e#470#471#0" expanded="true" />
377
-            <element signature="e#527#528#0" expanded="true" />
378
-            <element signature="e#589#590#0" expanded="true" />
379
-            <element signature="e#646#647#0" expanded="true" />
488
+            <element signature="imports" expanded="true" />
489
+            <element signature="e#504#505#0" expanded="true" />
490
+            <element signature="e#561#562#0" expanded="true" />
491
+            <element signature="e#616#617#0" expanded="true" />
492
+            <element signature="e#674#675#0" expanded="true" />
493
+            <element signature="e#1783#1784#0" expanded="true" />
494
+            <element signature="e#1810#1811#0" expanded="true" />
495
+            <element signature="e#4880#4881#0" expanded="true" />
496
+            <element signature="e#4918#4919#0" expanded="true" />
380 497
           </folding>
381 498
         </state>
382 499
       </provider>
383 500
     </entry>
384 501
     <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
385 502
       <provider selected="true" editor-type-id="text-editor">
386
-        <state relative-caret-position="375">
387
-          <caret line="25" column="25" selection-start-line="25" selection-start-column="25" selection-end-line="25" selection-end-column="25" />
503
+        <state relative-caret-position="386">
504
+          <caret line="203" lean-forward="true" selection-start-line="203" selection-end-line="203" />
388 505
           <folding>
389 506
             <element signature="imports" expanded="true" />
507
+            <element signature="e#8537#8546#0" expanded="true" />
508
+            <element signature="e#8823#8832#0" expanded="true" />
390 509
           </folding>
391 510
         </state>
392 511
       </provider>

+ 2
- 1
arraz/arraz.iml Voir le fichier

@@ -10,6 +10,7 @@
10 10
     </content>
11 11
     <orderEntry type="inheritedJdk" />
12 12
     <orderEntry type="sourceFolder" forTests="false" />
13
-    <orderEntry type="library" name="Maven: junit:junit:4.0" level="project" />
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" />
14 15
   </component>
15 16
 </module>

+ 1
- 1
arraz/pom.xml Voir le fichier

@@ -11,7 +11,7 @@
11 11
         <dependency>
12 12
             <groupId>junit</groupId>
13 13
             <artifactId>junit</artifactId>
14
-            <version>4.0</version>
14
+            <version>4.12</version>
15 15
         </dependency>
16 16
     </dependencies>
17 17
 

+ 316
- 10
arraz/src/main/java/Arraz.java Voir le fichier

@@ -1,34 +1,37 @@
1
+import java.util.ArrayList;
2
+import java.util.List;
3
+
1 4
 public class Arraz {
2 5
 
3
-    public static int sumValuesOfArray(int[] arr) {
6
+    public int sumValuesOfArray(int[] arr) {
4 7
         int output = 0;
5 8
 
6
-        for (int i = 0; i < arr.length; i++) {
7
-            output += arr[i];
9
+        for (int anArr : arr) {
10
+            output += anArr;
8 11
         }
9 12
 
10 13
         return output;
11 14
     }
12 15
 
13
-    public static double sumDoublesOfArray(double[] arr) {
16
+    public double sumDoublesOfArray(double[] arr) {
14 17
         double output = 0;
15 18
 
16
-        for (int i = 0; i < arr.length; i++) {
17
-            output += arr[i];
19
+        for (double anArr : arr) {
20
+            output += anArr;
18 21
         }
19 22
 
20 23
         return output;
21 24
     }
22 25
 
23
-    public static int averageOfArray(int[] arr) {
26
+    public int averageOfArray(int[] arr) {
24 27
         return sumValuesOfArray(arr) / arr.length;
25 28
     }
26 29
 
27
-    public static double doubleAverageOfArray(double[] arr){
30
+    public double doubleAverageOfArray(double[] arr){
28 31
         return sumDoublesOfArray(arr) / arr.length;
29 32
     }
30 33
 
31
-    public static boolean containsValue(int[] arr, int n) {
34
+    public boolean containsValue(int[] arr, int n) {
32 35
         for(int i = 0; i < arr.length; i++){
33 36
             if(arr[i] == n){
34 37
                 return true;
@@ -36,4 +39,307 @@ public class Arraz {
36 39
         }
37 40
         return false;
38 41
     }
39
-}
42
+
43
+    public int[] reverseArray(int[] arr) {
44
+        int[] output = new int[arr.length];
45
+        int counter = 0;
46
+        for(int i = arr.length - 1; i >= 0; i--){
47
+            output[counter] = arr[i];
48
+            if(i != 0) counter++;
49
+        }
50
+        return output;
51
+    }
52
+
53
+    public String getOddEvensOfArray(int[] arr){
54
+        int even = 0;
55
+        int odd = 0;
56
+
57
+        for (int anArr : arr) {
58
+            if (anArr % 2 == 0) {
59
+                even++;
60
+            } else {
61
+                odd++;
62
+            }
63
+        }
64
+        return "odds: " + odd + " evens: " + even;
65
+    }
66
+
67
+    public int findIndexOf(int[] arr, int n) {
68
+        for (int i = 0; i < arr.length; i++) {
69
+            if(arr[i] == n){
70
+                return i;
71
+            }
72
+        }
73
+        return -1;
74
+    }
75
+
76
+    public int[] copyArrayByLoop(int[] arr) {
77
+        int[] output = arr;
78
+        return output;
79
+    }
80
+
81
+    public int[] copyArrayByInterator(){
82
+        return null;
83
+    }
84
+
85
+    public int[] removeElementFromArray(int[] arr, int n) {
86
+        if(arr.length != 0) {
87
+            int count = 0;
88
+            int[] output = new int[arr.length - 1];
89
+            for (int i = 0; i < arr.length; i++) {
90
+                if (arr[i] != n) {
91
+                    output[count] = arr[i];
92
+                    count++;
93
+                }
94
+            }
95
+            return output;
96
+        }
97
+        return new int[] {-1};
98
+    }
99
+
100
+    public int[] InsertIntoArray(int[] arr, int n) {
101
+        int[] output = new int[arr.length + 1];
102
+        for (int i = 0; i < arr.length; i++) {
103
+            output[i] = arr[i];
104
+        }
105
+        output[arr.length] = n;
106
+        return output;
107
+    }
108
+
109
+    public String findMaxMinOfArray(int[] arr) {
110
+        int min = arr[0];
111
+        int max = arr[0];
112
+
113
+        for(int i = 1; i < arr.length; i++){
114
+            if(arr[i] < min){
115
+                min = arr[i];
116
+            }
117
+
118
+            if(arr[i] > max){
119
+                max = arr[i];
120
+            }
121
+        }
122
+        return "min: " + min + " max: " + max;
123
+    }
124
+
125
+    public int findMax(int[] arr){
126
+        int max = arr[0];
127
+        for(int i = 1; i < arr.length; i++){
128
+            if(arr[i] > max){
129
+                max = arr[i];
130
+            }
131
+        }
132
+        return max;
133
+    }
134
+
135
+    public int findMin(int[] arr){
136
+        int min = arr[0];
137
+        for(int i = 1; i < arr.length; i++){
138
+            if(arr[i] < min){
139
+                min = arr[i];
140
+            }
141
+        }
142
+        return min;
143
+    }
144
+
145
+    public int[] removeDupesFromArray(int[] arr) {
146
+        List dupes = collectDupes(arr);
147
+        int count = 0;
148
+        int[] output = new int[arr.length - dupes.size()];
149
+        for(int i = 0; i < arr.length; i++){
150
+            if(!dupes.contains(arr[i])){
151
+                output[count] = arr[i];
152
+                count++;
153
+            }
154
+        }
155
+
156
+        for(int j = 0; j < output.length; j++){
157
+            System.out.println(output[j]);
158
+        }
159
+
160
+        return output;
161
+    }
162
+
163
+    public List collectDupes(int[] arr){
164
+        List dupes = new ArrayList<Integer>();
165
+        for(int i = 0; i < arr.length; i++){
166
+            for(int j = 0; j < arr.length; j++){
167
+                if(arr[i] == arr[j] && i != j){
168
+                    dupes.add(arr[i]);
169
+                    break;
170
+                }
171
+            }
172
+        }
173
+        return dupes;
174
+    }
175
+
176
+    public int[] sort(int[] arr){
177
+        int temp;
178
+        for(int i = 0; i < arr.length; i++){
179
+            for(int j = 0; j < arr.length; j++){
180
+                if(arr[i] < arr[j] && i != j){
181
+                    temp = arr[i];
182
+                    arr[i] = arr[j];
183
+                    arr[j] = temp;
184
+                }
185
+            }
186
+        }
187
+        return arr;
188
+    }
189
+
190
+    public int find2ndLargestValueFromArray(int[] arr) {
191
+        sort(arr);
192
+        return arr[arr.length - 2];
193
+    }
194
+
195
+    public List makeMeAnArrayListFromArray(int[] arr){
196
+        List output = new ArrayList();
197
+        for(int i = 0; i < arr.length; i++){
198
+            output.add(arr[i]);
199
+        }
200
+        return output;
201
+    }
202
+
203
+
204
+    public Object[] makeMeAnArrayFromArrayList(List<Integer> given) {
205
+        return given.toArray();
206
+    }
207
+
208
+    public boolean check2ArraysForEqual(int[] arr1, int[] arr2) {
209
+        if(arr1.length == arr2.length) {
210
+            for (int i = 0; i < arr1.length; i++) {
211
+                if (arr1[i] != arr2[i]) {
212
+                    return false;
213
+                }
214
+            }
215
+            return true;
216
+        }
217
+        return false;
218
+    }
219
+
220
+    public int averageArrayWithoutMaxMin(int[] arr) {
221
+        int[] withOutMax = removeElementFromArray(arr, findMax(arr));
222
+        int[] withOutMin = removeElementFromArray(withOutMax, findMin(arr));
223
+        return averageOfArray(withOutMin);
224
+    }
225
+
226
+    public boolean arrayHas65and77(int[] arr) {
227
+        if(containsValue(arr, 65) && containsValue(arr, 77)) return true;
228
+        return false;
229
+    }
230
+
231
+    public boolean theTotalofTensIs30(int[] arr) {
232
+        int tens = 0;
233
+        for(int i = 0; i < arr.length; i++){
234
+            if(arr[i] == 10) tens++;
235
+        }
236
+        if(tens == 3) return true;
237
+        return false;
238
+    }
239
+
240
+    public String get2SmallestNumbers(int[] arr) {
241
+        int[] arr2 = sort(arr);
242
+        return "smallest: " + findMin(arr) + ", 2nd smallest: " + arr2[1];
243
+    }
244
+
245
+    public int[] makeMeACopyPlease(int[] arr){
246
+        int[] output = new int[arr.length];
247
+        int count = 0;
248
+        for(int i = output.length - 1; i >= 0; i--){
249
+            output[count] = arr[i];
250
+            count++;
251
+        }
252
+        return output;
253
+    }
254
+
255
+    public int[] removeLastItemAndCopy(int[] arr) {
256
+        int[] remove = removeElementFromArray(arr, arr[arr.length - 1]);
257
+        int[] output = copyArrayByLoop(remove);
258
+        return output;
259
+    }
260
+
261
+
262
+    public int[] removeFirstItemAndCopy(int[] arr) {
263
+        int[] arr2 = new int[arr.length - 1];
264
+        for (int i = 1; i < arr.length; i++) {
265
+            arr2[i - 1] = arr[i];
266
+        }
267
+        return copyArrayByLoop(arr2);
268
+    }
269
+
270
+    public int[] insertAtStartAndCopy(int[] arr, int n) {
271
+        int[] output = new int[arr.length + 1];
272
+        output[0] = n;
273
+        for(int i = 1; i < output.length; i++){
274
+            output[i] = arr[i - 1];
275
+        }
276
+        return copyArrayByLoop(output);
277
+    }
278
+
279
+    public int[] insertAtEndAndCopy(int[] arr, int n) {
280
+        int[] output = new int[arr.length + 1];
281
+        output[arr.length] = n;
282
+        for(int i = 0; i < arr.length; i++){
283
+            output[i] = arr[i];
284
+        }
285
+        return copyArrayByLoop(output);
286
+    }
287
+
288
+    public int countEven(int[] arr){
289
+        int even = 0;
290
+        for(int i = 0; i < arr.length; i++){
291
+            if(arr[i] % 2 == 0) even++;
292
+        }
293
+        return even;
294
+    }
295
+
296
+    public int countOdd(int[] arr){
297
+        int odd = 0;
298
+        for(int i = 0; i < arr.length; i++){
299
+            if(arr[i] % 2 != 0) odd++;
300
+        }
301
+        return odd;
302
+    }
303
+
304
+    public int[] createEvenArray(int[] arr){
305
+        int[] evens = new int[countEven(arr)];
306
+        int evenCount = 0;
307
+        for (int anArr : arr) {
308
+            if (anArr % 2 == 0) {
309
+                evens[evenCount] = anArr;
310
+                evenCount++;
311
+            }
312
+        }
313
+        return evens;
314
+    }
315
+
316
+    public int[] createOddArray(int[] arr){
317
+        int[] odds = new int[countOdd(arr)];
318
+        int oddCount = 0;
319
+        for (int anArr : arr) {
320
+            if (anArr % 2 != 0) {
321
+                odds[oddCount] = anArr;
322
+                oddCount++;
323
+            }
324
+        }
325
+        return odds;
326
+    }
327
+
328
+    public int[] mergeIntArrays(int[] arr1, int[] arr2){
329
+        int [] output = new int[arr1.length + arr2.length];
330
+        for(int k = 0; k < output.length; k++){
331
+            if(k < arr1.length){
332
+                output[k] = arr1[k];
333
+            }else{
334
+                output[k] = arr2[k - arr1.length];
335
+            }
336
+        }
337
+        return output;
338
+    }
339
+
340
+    public int[] sortArrayIntoEvensThenOdds(int[] arr){
341
+        int[] evens = sort(createEvenArray(arr));
342
+        int[] odds = sort(createOddArray(arr));
343
+        return mergeIntArrays(evens, odds);
344
+    }
345
+}

+ 467
- 14
arraz/src/test/java/ArrazTest.java Voir le fichier

@@ -1,15 +1,18 @@
1 1
 import org.junit.Assert;
2 2
 import org.junit.Test;
3 3
 
4
-import static org.junit.Assert.*;
4
+import java.util.ArrayList;
5
+import java.util.List;
5 6
 
6 7
 public class ArrazTest {
7 8
 
9
+    private Arraz arraz = new Arraz();
10
+    
8 11
     @Test
9 12
     public void testSumValuesOfArrayPostive(){
10 13
         int[] arr = new int[] {2, 3, 4, 5, 6, 7};
11 14
 
12
-        int output = Arraz.sumValuesOfArray(arr);
15
+        int output = arraz.sumValuesOfArray(arr);
13 16
 
14 17
         int expected = 27;
15 18
         int actual = output;
@@ -21,7 +24,7 @@ public class ArrazTest {
21 24
     public void testSumValuesOfArrayNegative(){
22 25
         int[] arr = new int[] {2, -3, 4, 5, 6, 7};
23 26
 
24
-        int output = Arraz.sumValuesOfArray(arr);
27
+        int output = arraz.sumValuesOfArray(arr);
25 28
 
26 29
         int expected = 21;
27 30
         int actual = output;
@@ -34,7 +37,7 @@ public class ArrazTest {
34 37
 
35 38
         double[] arr = new double[] {2.5, .1, 4.2, .2};
36 39
 
37
-        double actual = Arraz.sumDoublesOfArray(arr);
40
+        double actual = arraz.sumDoublesOfArray(arr);
38 41
 
39 42
         double expected  = 7;
40 43
 
@@ -46,7 +49,7 @@ public class ArrazTest {
46 49
 
47 50
         double[] arr = new double[] {2.5, -.1, 4.2, .2};
48 51
 
49
-        double actual = Arraz.sumDoublesOfArray(arr);
52
+        double actual = arraz.sumDoublesOfArray(arr);
50 53
 
51 54
         double expected  = 6.8;
52 55
 
@@ -58,7 +61,7 @@ public class ArrazTest {
58 61
 
59 62
         int[] arr = new int[] {1,1,1,1,1,1,1};
60 63
 
61
-        int actual = Arraz.averageOfArray(arr);
64
+        int actual = arraz.averageOfArray(arr);
62 65
 
63 66
         int expected = 1;
64 67
 
@@ -70,7 +73,7 @@ public class ArrazTest {
70 73
 
71 74
         int[] arr = new int[] {1,2,34,3,1,1,-122};
72 75
 
73
-        int actual = Arraz.averageOfArray(arr);
76
+        int actual = arraz.averageOfArray(arr);
74 77
 
75 78
         int expected = -11;
76 79
 
@@ -81,18 +84,18 @@ public class ArrazTest {
81 84
     public void testDoubleAverageOfArray(){
82 85
         double[] arr = new double[] {1,1,1,1,1,1,1};
83 86
 
84
-        double actual = Arraz.doubleAverageOfArray(arr);
87
+        double actual = arraz.doubleAverageOfArray(arr);
85 88
 
86 89
         double expected = 1;
87 90
 
88
-        Assert.assertEquals(expected, actual);
91
+        Assert.assertEquals(expected, actual, 0);
89 92
     }
90 93
 
91 94
     @Test
92 95
     public void testDoubleAverageOfArray2(){
93 96
         double[] arr = new double[] {2.4,23.4,43,12,5,2,54,.5};
94 97
 
95
-        double actual = Arraz.doubleAverageOfArray(arr);
98
+        double actual = arraz.doubleAverageOfArray(arr);
96 99
 
97 100
         double expected = 17.7875;
98 101
 
@@ -103,18 +106,468 @@ public class ArrazTest {
103 106
     public void testContainsValueFalse(){
104 107
         int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
105 108
 
106
-        boolean expected = false;
107
-        boolean actual = Arraz.containsValue(arr, 10);
109
+        boolean actual = arraz.containsValue(arr, 10);
108 110
 
109
-        Assert.assertEquals(expected, actual);
111
+        Assert.assertFalse(actual);
110 112
     }
111 113
 
112 114
     @Test
113 115
     public void testContainsValueTrue(){
114 116
         int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
115 117
 
116
-        boolean actual = Arraz.containsValue(arr, 5);
118
+        boolean actual = arraz.containsValue(arr, 5);
117 119
 
118 120
         Assert.assertTrue(actual);
119 121
     }
122
+
123
+    @Test
124
+    public void testReverseArray1(){
125
+        int[] arr = new int[] {9,8,7,6,5,4,3,2,1};
126
+
127
+        Assert.assertArrayEquals(new int[] {1,2,3,4,5,6,7,8,9}, arraz.reverseArray(arr));
128
+    }
129
+
130
+    @Test
131
+    public void testReverseArray2(){
132
+        int[] arr = new int[] {2,4,53,2,4,56,64,2};
133
+
134
+        int[] expected = new int[] {2,64,56,4,2,53,4,2};
135
+        int[] actual = arraz.reverseArray(arr);
136
+
137
+        Assert.assertArrayEquals(expected, actual);
138
+    }
139
+
140
+    @Test
141
+    public void testOddEven1(){
142
+        int[] arr = new int[] {2,2,2,2,2,1,1,1,1};
143
+
144
+        String expected = "odds: 4 evens: 5";
145
+        String actual = arraz.getOddEvensOfArray(arr);
146
+
147
+        Assert.assertEquals(expected, actual);
148
+    }
149
+
150
+    @Test
151
+    public void testOddEven2(){
152
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
153
+
154
+        String expected = "odds: 5 evens: 4";
155
+        String actual = arraz.getOddEvensOfArray(arr);
156
+
157
+        Assert.assertEquals(expected, actual);
158
+    }
159
+
160
+    @Test
161
+    public void testFindIndexOf1(){
162
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
163
+
164
+        int expected = 1;
165
+        int actual = arraz.findIndexOf(arr, 2);
166
+
167
+        Assert.assertEquals(expected, actual);
168
+    }
169
+
170
+    @Test
171
+    public void testFindIndexOf2(){
172
+        int[] arr = new int[] {2,4,2,4,5,332,22,44,32,1};
173
+
174
+        int expected = -1;
175
+        int actual = arraz.findIndexOf(arr, -332);
176
+
177
+        Assert.assertEquals(expected, actual);
178
+    }
179
+
180
+    @Test
181
+    public void testCopyArrayByLoop1(){
182
+        int[] arr = new int[] {1,2,3,4,5,6,7,8};
183
+
184
+        int[] actual = arraz.copyArrayByLoop(arr);
185
+
186
+        Assert.assertEquals(arr, actual);
187
+        Assert.assertNotNull(actual);
188
+    }
189
+
190
+    @Test
191
+    public void testCopyArrayByLoop2(){
192
+        int[] arr = new int[] {1,2,3,5,543,322,235,4,6674,3};
193
+
194
+        int[] actual = arraz.copyArrayByLoop(arr);
195
+
196
+        Assert.assertEquals(arr, actual);
197
+        Assert.assertNotNull(actual);
198
+    }
199
+
200
+    @Test
201
+    public void testCopyArrayByInterator1(){
202
+
203
+    }
204
+
205
+    @Test
206
+    public void testCopyArrayByInterator2(){
207
+
208
+    }
209
+
210
+    @Test
211
+    public void testRemoveElementFromArray1(){
212
+        int[] arr = new int[]{1,2,3,4,5,6,7,8,9};
213
+
214
+        int[] expected = new int[]{2,3,4,5,6,7,8,9};
215
+        int[] actual = arraz.removeElementFromArray(arr, 1);
216
+
217
+        Assert.assertArrayEquals(expected, actual);
218
+    }
219
+
220
+    @Test
221
+    public void testRemoveElementFromArray2(){
222
+        int[] arr = new int[]{0};
223
+
224
+        int[] expected = new int[]{};
225
+        int[] actual = arraz.removeElementFromArray(arr, 0);
226
+
227
+        Assert.assertArrayEquals(expected, actual);
228
+        Assert.assertEquals(0, actual.length);
229
+    }
230
+
231
+    @Test
232
+    public void testRemoveElementFromArray3(){
233
+        int[] arr = new int[]{};
234
+
235
+        int[] expected = new int[]{-1};
236
+        int[] actual = arraz.removeElementFromArray(arr, 1);
237
+
238
+        Assert.assertArrayEquals(expected, actual);
239
+    }
240
+
241
+    @Test
242
+    public void testInsertIntoArrayAt1(){
243
+        int[] arr = new int[]{1,2,3,4,5,6,7,8,9};
244
+
245
+        int[] expected = new int[]{1,2,3,4,5,6,7,8,9,10};
246
+        int[] actual = arraz.InsertIntoArray(arr, 10);
247
+
248
+        Assert.assertArrayEquals(expected, actual);
249
+    }
250
+
251
+    @Test
252
+    public void testInsertIntoArrayAt2(){
253
+        int[] arr = new int[]{};
254
+
255
+        int[] expected = new int[]{10};
256
+        int[] actual = arraz.InsertIntoArray(arr, 10);
257
+
258
+        Assert.assertArrayEquals(expected, actual);
259
+    }
260
+
261
+    @Test
262
+    public void testFindMaxMinOfArray1(){
263
+        int[] arr = new int[]{1,2,3,4,5,6,7,8,9};
264
+
265
+        String expected = "min: 1 max: 9";
266
+        String actual = arraz.findMaxMinOfArray(arr);
267
+
268
+        Assert.assertEquals(expected, actual);
269
+    }
270
+
271
+    @Test
272
+    public void testFindMaxMinOfArray2(){
273
+        int[] arr = new int[]{-23,3,5,6433,-54};
274
+
275
+        String expected = "min: -54 max: 6433";
276
+        String actual = arraz.findMaxMinOfArray(arr);
277
+
278
+        Assert.assertEquals(expected, actual);
279
+    }
280
+
281
+    @Test
282
+    public void testRemoveDupesFromArray1(){
283
+        int[] arr = new int[]{2,3,44,4,4,65,2};
284
+
285
+        int[] expected = new int[]{3,44,65};
286
+        int[] actual = arraz.removeDupesFromArray(arr);
287
+
288
+        Assert.assertArrayEquals(expected, actual);
289
+    }
290
+
291
+    @Test
292
+    public void testRemoveDupesFromArray2(){
293
+        int[] arr = new int[]{0,1,1,1,1,1,1,1};
294
+
295
+        int[] expected = new int[]{0};
296
+        int[] actual = arraz.removeDupesFromArray(arr);
297
+
298
+        Assert.assertArrayEquals(expected, actual);
299
+    }
300
+
301
+    @Test
302
+    public void testSort1(){
303
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
304
+
305
+        int[] expected  = new int[] {1,2,3,4,5,6,7,8,9};
306
+        int[] actual = arraz.sort(arr);
307
+
308
+        Assert.assertArrayEquals(expected, actual);
309
+    }
310
+
311
+    @Test
312
+    public void testSort2(){
313
+        int[] arr = new int[] {1,9,3,4,6,5,7,8,2};
314
+
315
+        int[] expected  = new int[] {1,2,3,4,5,6,7,8,9};
316
+        int[] actual = arraz.sort(arr);
317
+
318
+        Assert.assertArrayEquals(expected, actual);
319
+    }
320
+
321
+    @Test
322
+    public void testFind2ndLargestValueFromArray1(){
323
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
324
+
325
+        int expected =  8;
326
+        int actual = arraz.find2ndLargestValueFromArray(arr);
327
+
328
+        Assert.assertEquals(expected, actual);
329
+    }
330
+
331
+    @Test
332
+    public void testFind2ndLargestValueFromArray2(){
333
+        int[] arr = new int[] {2,334,523,232,78,45,8876,23};
334
+
335
+        int expected =  523;
336
+        int actual = arraz.find2ndLargestValueFromArray(arr);
337
+
338
+        Assert.assertEquals(expected, actual);
339
+    }
340
+
341
+    @Test
342
+    public void testMakeMeAnArrayListFromArray1(){
343
+        int[] arr = new int[] {0};
344
+
345
+        List actual = arraz.makeMeAnArrayListFromArray(arr);
346
+
347
+        Assert.assertTrue(actual.contains(0));
348
+    }
349
+
350
+    @Test
351
+    public void testMakeMeAnArrayListFromArra2(){
352
+        int[] arr = new int[] {1,2,3,4,5};
353
+
354
+        List actual = arraz.makeMeAnArrayListFromArray(arr);
355
+
356
+        Assert.assertTrue(actual.contains(1));
357
+        Assert.assertTrue(actual.contains(2));
358
+        Assert.assertTrue(actual.contains(3));
359
+        Assert.assertTrue(actual.contains(4));
360
+        Assert.assertTrue(actual.contains(5));
361
+    }
362
+
363
+    @Test
364
+    public void testMakeMeAnArrayFromArrayList1(){
365
+        List<Integer> given = new ArrayList<Integer>();
366
+        given.add(23);
367
+        given.add(45);
368
+
369
+        Object[] actual = arraz.makeMeAnArrayFromArrayList(given);
370
+
371
+        Assert.assertEquals(2, actual.length);
372
+    }
373
+
374
+    @Test
375
+    public void testMakeMeAnArrayFromArrayList2(){
376
+        List<Integer> given = new ArrayList<Integer>();
377
+        given.add(0);
378
+
379
+        Object[] actual = arraz.makeMeAnArrayFromArrayList(given);
380
+
381
+        Assert.assertEquals(1, actual.length);
382
+    }
383
+
384
+    @Test
385
+    public void testCheck2ArraysForEqual1(){
386
+        int[] arr1 = new int[] {1,2,3,4,5,6,7,8,9};
387
+        int[] arr2 = new int[] {1,2,3,4,5,6,7,8,9};
388
+
389
+        Assert.assertTrue(arraz.check2ArraysForEqual(arr1, arr2));
390
+    }
391
+
392
+    @Test
393
+    public void testCheck2ArraysForEqual2(){
394
+        int[] arr1 = new int[] {1,2,3,4,5,6,7,8,9};
395
+        int[] arr2 = new int[] {1,2,3,5,4,6,7,8,9};
396
+
397
+        Assert.assertFalse(arraz.check2ArraysForEqual(arr1, arr2));
398
+    }
399
+
400
+    @Test
401
+    public void testCheck2ArraysForEqual3(){
402
+        int[] arr1 = new int[] {1,2,3,4,5,6,7,8,9,10};
403
+        int[] arr2 = new int[] {1,2,3,5,4,6,7,8,9};
404
+
405
+        Assert.assertFalse(arraz.check2ArraysForEqual(arr1, arr2));
406
+    }
407
+
408
+    @Test
409
+    public void testAverageArrayWithoutMaxMin1(){
410
+        int[] arr = new int[] {100000,1,1,1,1,1,1,1,1,1,1,-1000};
411
+
412
+        Assert.assertEquals(1, arraz.averageArrayWithoutMaxMin(arr));
413
+    }
414
+
415
+    @Test
416
+    public void testAverageArrayWithoutMaxMin2(){
417
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
418
+
419
+        Assert.assertEquals(5, arraz.averageArrayWithoutMaxMin(arr));
420
+    }
421
+
422
+    @Test
423
+    public void testArrayHas65and771(){
424
+        int[] arr = new int[] {1,2,3,4,5,65,7,8,9};
425
+
426
+        Assert.assertFalse(arraz.arrayHas65and77(arr));
427
+    }
428
+
429
+    @Test
430
+    public void testArrayHas65and772(){
431
+        int[] arr = new int[] {1,2,3,4,5,65,77,8,9};
432
+
433
+        Assert.assertTrue(arraz.arrayHas65and77(arr));
434
+    }
435
+
436
+    @Test
437
+    public void testTheTotalofTensIs301(){
438
+        int[] arr = new int[] {10,10,10};
439
+
440
+        Assert.assertTrue(arraz.theTotalofTensIs30(arr));
441
+    }
442
+
443
+    @Test
444
+    public void testTheTotalofTensIs302(){
445
+        int[] arr = new int[] {10,10};
446
+
447
+        Assert.assertFalse(arraz.theTotalofTensIs30(arr));
448
+    }
449
+
450
+    @Test
451
+    public void testGet2SmallestNumbers1(){
452
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
453
+
454
+        String expected = "smallest: 1, 2nd smallest: 2";
455
+        Assert.assertEquals(expected, arraz.get2SmallestNumbers(arr));
456
+    }
457
+
458
+    @Test
459
+    public void testGet2SmallestNumbers2(){
460
+        int[] arr = new int[] {23,2,55,34664,223,554,22,-1};
461
+
462
+        String expected = "smallest: -1, 2nd smallest: 2";
463
+        Assert.assertEquals(expected, arraz.get2SmallestNumbers(arr));
464
+    }
465
+
466
+    @Test
467
+    public void testMakeMeACopyPlease1(){
468
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
469
+
470
+        int[] expected = new int[] {9,8,7,6,5,4,3,2,1};
471
+        Assert.assertArrayEquals(expected, arraz.makeMeACopyPlease(arr));
472
+    }
473
+
474
+    @Test
475
+    public void testMakeMeACopyPlease2(){
476
+        int[] arr = new int[] {2,3,542,12,55,3,2,45,67};
477
+
478
+        int[] expected = new int[] {67,45,2,3,55,12,542,3,2};
479
+        Assert.assertArrayEquals(expected, arraz.makeMeACopyPlease(arr));
480
+    }
481
+
482
+    @Test
483
+    public void testRemoveLastItemAndCopy1(){
484
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
485
+
486
+        int[] expected = new int[] {1,2,3,4,5,6,7,8};
487
+
488
+        Assert.assertArrayEquals(expected, arraz.removeLastItemAndCopy(arr));
489
+    }
490
+
491
+    @Test
492
+    public void testRemoveLastItemAndCopy2(){
493
+        int[] arr = new int[] {1,2,445,32,3,6,545326,34,6262,73,2634,358,12};
494
+
495
+        int[] expected = new int[] {1,2,445,32,3,6,545326,34,6262,73,2634,358};
496
+
497
+        Assert.assertArrayEquals(expected, arraz.removeLastItemAndCopy(arr));
498
+    }
499
+
500
+    @Test
501
+    public void testRemoveFirstItemAndCopy1(){
502
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
503
+
504
+        int[] output = arraz.removeFirstItemAndCopy(arr);
505
+
506
+        Assert.assertEquals(8, output.length);
507
+        Assert.assertTrue(!arraz.containsValue(output, 1));
508
+    }
509
+
510
+    @Test
511
+    public void testRemoveFirstItemAndCopy2(){
512
+        int[] arr = new int[] {10};
513
+
514
+        int[] output = arraz.removeFirstItemAndCopy(arr);
515
+
516
+        Assert.assertEquals(0, output.length);
517
+        Assert.assertTrue(!arraz.containsValue(output, 10));
518
+    }
519
+
520
+    @Test
521
+    public void testInsertAtStartAndCopy1(){
522
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
523
+
524
+        int[] expected = new int[] {10,1,2,3,4,5,6,7,8,9};
525
+
526
+        Assert.assertArrayEquals(expected, arraz.insertAtStartAndCopy(arr, 10));
527
+    }
528
+
529
+    @Test
530
+    public void testInsertAtStartAndCopy2(){
531
+        int[] arr = new int[] {};
532
+
533
+        int[] expected = new int[] {10};
534
+
535
+        Assert.assertArrayEquals(expected, arraz.insertAtStartAndCopy(arr, 10));
536
+    }
537
+
538
+    @Test
539
+    public void testInsertAtEndAndCopy1(){
540
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
541
+
542
+        int[] expected = new int[] {1,2,3,4,5,6,7,8,9,10};
543
+
544
+        Assert.assertArrayEquals(expected, arraz.insertAtEndAndCopy(arr, 10));
545
+    }
546
+
547
+    @Test
548
+    public void testInsertAtEndAndCopy2(){
549
+        int[] arr = new int[] {};
550
+
551
+        int[] expected = new int[] {10};
552
+
553
+        Assert.assertArrayEquals(expected, arraz.insertAtEndAndCopy(arr, 10));
554
+    }
555
+
556
+    @Test
557
+    public void testSortArrayIntoEvensThenOdds1(){
558
+        int[] arr = new int[] {4,5,102,6,-7,12,-32,92,8};
559
+
560
+        int[] expected = new int[] {-32, 4, 6, 8, 12, 92, 102, -7, 5};
561
+
562
+        Assert.assertArrayEquals(expected, arraz.sortArrayIntoEvensThenOdds(arr));
563
+    }
564
+
565
+    @Test
566
+    public void testSortArrayIntoEvensThenOdds2(){
567
+        int[] arr = new int[] {1,2,3,4,5,6,7,8,9};
568
+
569
+        int[] expected = new int[] {2,4,6,8,1,3,5,7,9};
570
+
571
+        Assert.assertArrayEquals(expected, arraz.sortArrayIntoEvensThenOdds(arr));
572
+    }
120 573
 }