#25 Curtis Cook

Offen
CurtisMCook möchte 1 Commits von CurtisMCook/ArraysGoneWild:master nach master zusammenführen

+ 16
- 0
arraz/.idea/compiler.xml Datei anzeigen

@@ -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="arraz" />
10
+      </profile>
11
+    </annotationProcessing>
12
+    <bytecodeTargetLevel>
13
+      <module name="arraz" target="6" />
14
+    </bytecodeTargetLevel>
15
+  </component>
16
+</project>

+ 4
- 0
arraz/.idea/encodings.xml Datei anzeigen

@@ -0,0 +1,4 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="Encoding" addBOMForNewFiles="with NO BOM" />
4
+</project>

+ 13
- 0
arraz/.idea/libraries/Maven__junit_junit_4_12.xml Datei anzeigen

@@ -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
arraz/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml Datei anzeigen

@@ -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
arraz/.idea/misc.xml Datei anzeigen

@@ -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
arraz/.idea/modules.xml Datei anzeigen

@@ -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$/arraz.iml" filepath="$PROJECT_DIR$/arraz.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
arraz/.idea/vcs.xml Datei anzeigen

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

+ 505
- 0
arraz/.idea/workspace.xml Datei anzeigen

@@ -0,0 +1,505 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="ccd5c7b2-1d27-4aed-afad-474eb9d95589" name="Default Changelist" 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/modules.xml" afterDir="false" />
9
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
10
+      <change afterPath="$PROJECT_DIR$/src/main/java/MaxMin.java" afterDir="false" />
11
+      <change afterPath="$PROJECT_DIR$/src/main/java/OddEven.java" afterDir="false" />
12
+      <change afterPath="$PROJECT_DIR$/src/main/java/SmallestFirstAndSecond.java" afterDir="false" />
13
+      <change afterPath="$PROJECT_DIR$/src/test/java/MaxMinTest.java" afterDir="false" />
14
+      <change afterPath="$PROJECT_DIR$/src/test/java/OddEvenTest.java" afterDir="false" />
15
+      <change afterPath="$PROJECT_DIR$/src/test/java/SmallestFirstAndSecondTest.java" afterDir="false" />
16
+      <change beforePath="$PROJECT_DIR$/arraz.iml" beforeDir="false" afterPath="$PROJECT_DIR$/arraz.iml" afterDir="false" />
17
+      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
18
+      <change beforePath="$PROJECT_DIR$/src/main/java/Arraz.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Arraz.java" afterDir="false" />
19
+      <change beforePath="$PROJECT_DIR$/src/test/java/ArrazTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/ArrazTest.java" afterDir="false" />
20
+    </list>
21
+    <ignored path="$PROJECT_DIR$/target/" />
22
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
23
+    <option name="SHOW_DIALOG" value="false" />
24
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
25
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
26
+    <option name="LAST_RESOLUTION" value="IGNORE" />
27
+  </component>
28
+  <component name="CoverageDataManager">
29
+    <SUITE FILE_PATH="coverage/arraz$ArrazTest.ic" NAME="ArrazTest Coverage Results" MODIFIED="1544055930582" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" />
30
+  </component>
31
+  <component name="FileEditorManager">
32
+    <splitter split-orientation="horizontal" split-proportion="0.5">
33
+      <split-first>
34
+        <leaf>
35
+          <file pinned="false" current-in-tab="true">
36
+            <entry file="file://$PROJECT_DIR$/src/main/java/Arraz.java">
37
+              <provider selected="true" editor-type-id="text-editor">
38
+                <state relative-caret-position="648">
39
+                  <caret line="229" column="29" lean-forward="true" selection-start-line="229" selection-start-column="29" selection-end-line="229" selection-end-column="29" />
40
+                  <folding>
41
+                    <element signature="imports" expanded="true" />
42
+                    <element signature="e#3449#3450#0" expanded="true" />
43
+                    <element signature="e#3497#3498#0" expanded="true" />
44
+                    <element signature="e#3562#3563#0" expanded="true" />
45
+                    <element signature="e#3623#3624#0" expanded="true" />
46
+                    <element signature="e#4537#4538#0" expanded="true" />
47
+                    <element signature="e#4610#4611#0" expanded="true" />
48
+                    <element signature="e#4890#4891#0" expanded="true" />
49
+                    <element signature="e#4931#4932#0" expanded="true" />
50
+                    <element signature="e#6397#6406#0" expanded="true" />
51
+                    <element signature="e#6464#6473#0" expanded="true" />
52
+                  </folding>
53
+                </state>
54
+              </provider>
55
+            </entry>
56
+          </file>
57
+        </leaf>
58
+      </split-first>
59
+      <split-second>
60
+        <leaf>
61
+          <file pinned="false" current-in-tab="true">
62
+            <entry file="file://$PROJECT_DIR$/src/test/java/ArrazTest.java">
63
+              <provider selected="true" editor-type-id="text-editor">
64
+                <state relative-caret-position="5348">
65
+                  <caret line="655" column="18" selection-start-line="655" selection-start-column="18" selection-end-line="655" selection-end-column="18" />
66
+                  <folding>
67
+                    <element signature="imports" expanded="true" />
68
+                  </folding>
69
+                </state>
70
+              </provider>
71
+            </entry>
72
+          </file>
73
+        </leaf>
74
+      </split-second>
75
+    </splitter>
76
+  </component>
77
+  <component name="FileTemplateManagerImpl">
78
+    <option name="RECENT_TEMPLATES">
79
+      <list>
80
+        <option value="Class" />
81
+      </list>
82
+    </option>
83
+  </component>
84
+  <component name="FindInProjectRecents">
85
+    <findStrings>
86
+      <find>arraylist</find>
87
+    </findStrings>
88
+  </component>
89
+  <component name="Git.Settings">
90
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
91
+  </component>
92
+  <component name="IdeDocumentHistory">
93
+    <option name="CHANGED_PATHS">
94
+      <list>
95
+        <option value="$PROJECT_DIR$/pom.xml" />
96
+        <option value="$PROJECT_DIR$/src/main/java/OddEven.java" />
97
+        <option value="$PROJECT_DIR$/src/test/java/OddEvenTest.java" />
98
+        <option value="$PROJECT_DIR$/src/main/java/MaxMin.java" />
99
+        <option value="$PROJECT_DIR$/src/test/java/MaxMinTest.java" />
100
+        <option value="$PROJECT_DIR$/src/test/java/SmallestFirstAndSecondTest.java" />
101
+        <option value="$PROJECT_DIR$/src/main/java/SmallestFirstAndSecond.java" />
102
+        <option value="$PROJECT_DIR$/src/main/java/Arraz.java" />
103
+        <option value="$PROJECT_DIR$/src/test/java/ArrazTest.java" />
104
+      </list>
105
+    </option>
106
+  </component>
107
+  <component name="MavenImportPreferences">
108
+    <option name="importingSettings">
109
+      <MavenImportingSettings>
110
+        <option name="importAutomatically" value="true" />
111
+      </MavenImportingSettings>
112
+    </option>
113
+  </component>
114
+  <component name="ProjectFrameBounds" fullScreen="true">
115
+    <option name="x" value="722" />
116
+    <option name="width" value="718" />
117
+    <option name="height" value="900" />
118
+  </component>
119
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
120
+  <component name="ProjectView">
121
+    <navigator proportions="" version="1">
122
+      <foldersAlwaysOnTop value="true" />
123
+    </navigator>
124
+    <panes>
125
+      <pane id="Scope" />
126
+      <pane id="ProjectPane">
127
+        <subPane>
128
+          <expand>
129
+            <path>
130
+              <item name="arraz" type="b2602c69:ProjectViewProjectNode" />
131
+              <item name="arraz" type="462c0819:PsiDirectoryNode" />
132
+            </path>
133
+            <path>
134
+              <item name="arraz" type="b2602c69:ProjectViewProjectNode" />
135
+              <item name="arraz" type="462c0819:PsiDirectoryNode" />
136
+              <item name="src" type="462c0819:PsiDirectoryNode" />
137
+            </path>
138
+            <path>
139
+              <item name="arraz" type="b2602c69:ProjectViewProjectNode" />
140
+              <item name="arraz" type="462c0819:PsiDirectoryNode" />
141
+              <item name="src" type="462c0819:PsiDirectoryNode" />
142
+              <item name="main" type="462c0819:PsiDirectoryNode" />
143
+            </path>
144
+            <path>
145
+              <item name="arraz" type="b2602c69:ProjectViewProjectNode" />
146
+              <item name="arraz" type="462c0819:PsiDirectoryNode" />
147
+              <item name="src" type="462c0819:PsiDirectoryNode" />
148
+              <item name="main" type="462c0819:PsiDirectoryNode" />
149
+              <item name="java" type="462c0819:PsiDirectoryNode" />
150
+            </path>
151
+            <path>
152
+              <item name="arraz" type="b2602c69:ProjectViewProjectNode" />
153
+              <item name="arraz" type="462c0819:PsiDirectoryNode" />
154
+              <item name="src" type="462c0819:PsiDirectoryNode" />
155
+              <item name="test" type="462c0819:PsiDirectoryNode" />
156
+            </path>
157
+            <path>
158
+              <item name="arraz" type="b2602c69:ProjectViewProjectNode" />
159
+              <item name="arraz" type="462c0819:PsiDirectoryNode" />
160
+              <item name="src" type="462c0819:PsiDirectoryNode" />
161
+              <item name="test" type="462c0819:PsiDirectoryNode" />
162
+              <item name="java" type="462c0819:PsiDirectoryNode" />
163
+            </path>
164
+          </expand>
165
+          <select />
166
+        </subPane>
167
+      </pane>
168
+      <pane id="PackagesPane" />
169
+    </panes>
170
+  </component>
171
+  <component name="PropertiesComponent">
172
+    <property name="WebServerToolWindowFactoryState" value="false" />
173
+    <property name="aspect.path.notification.shown" value="true" />
174
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544404337114" />
175
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
176
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
177
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
178
+    <property name="project.structure.last.edited" value="Project" />
179
+    <property name="project.structure.proportion" value="0.15" />
180
+    <property name="project.structure.side.proportion" value="0.0" />
181
+    <property name="settings.editor.selected.configurable" value="vcs.Git" />
182
+  </component>
183
+  <component name="RunDashboard">
184
+    <option name="ruleStates">
185
+      <list>
186
+        <RuleState>
187
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
188
+        </RuleState>
189
+        <RuleState>
190
+          <option name="name" value="StatusDashboardGroupingRule" />
191
+        </RuleState>
192
+      </list>
193
+    </option>
194
+  </component>
195
+  <component name="RunManager" selected="JUnit.All in arraz">
196
+    <configuration name="All in arraz" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
197
+      <module name="arraz" />
198
+      <option name="PACKAGE_NAME" value="" />
199
+      <option name="TEST_OBJECT" value="package" />
200
+      <method v="2">
201
+        <option name="Make" enabled="true" />
202
+      </method>
203
+    </configuration>
204
+    <configuration name="ArrazTest.test1insertAtEndAndCopy" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
205
+      <module name="arraz" />
206
+      <option name="PACKAGE_NAME" value="" />
207
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
208
+      <option name="METHOD_NAME" value="test1insertAtEndAndCopy" />
209
+      <option name="TEST_OBJECT" value="method" />
210
+      <method v="2">
211
+        <option name="Make" enabled="true" />
212
+      </method>
213
+    </configuration>
214
+    <configuration name="ArrazTest.test1sortArrayIntoEvensThenOdds" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
215
+      <module name="arraz" />
216
+      <option name="PACKAGE_NAME" value="" />
217
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
218
+      <option name="METHOD_NAME" value="test1sortArrayIntoEvensThenOdds" />
219
+      <option name="TEST_OBJECT" value="method" />
220
+      <method v="2">
221
+        <option name="Make" enabled="true" />
222
+      </method>
223
+    </configuration>
224
+    <configuration name="ArrazTest.test2insertAtEndAndCopy" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
225
+      <module name="arraz" />
226
+      <option name="PACKAGE_NAME" value="" />
227
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
228
+      <option name="METHOD_NAME" value="test2insertAtEndAndCopy" />
229
+      <option name="TEST_OBJECT" value="method" />
230
+      <method v="2">
231
+        <option name="Make" enabled="true" />
232
+      </method>
233
+    </configuration>
234
+    <configuration name="ArrazTest.test2sortArrayIntoEvensThenOdds" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
235
+      <module name="arraz" />
236
+      <option name="PACKAGE_NAME" value="" />
237
+      <option name="MAIN_CLASS_NAME" value="ArrazTest" />
238
+      <option name="METHOD_NAME" value="test2sortArrayIntoEvensThenOdds" />
239
+      <option name="TEST_OBJECT" value="method" />
240
+      <method v="2">
241
+        <option name="Make" enabled="true" />
242
+      </method>
243
+    </configuration>
244
+    <recent_temporary>
245
+      <list>
246
+        <item itemvalue="JUnit.All in arraz" />
247
+        <item itemvalue="JUnit.ArrazTest.test2sortArrayIntoEvensThenOdds" />
248
+        <item itemvalue="JUnit.ArrazTest.test1sortArrayIntoEvensThenOdds" />
249
+        <item itemvalue="JUnit.ArrazTest.test2insertAtEndAndCopy" />
250
+        <item itemvalue="JUnit.ArrazTest.test1insertAtEndAndCopy" />
251
+      </list>
252
+    </recent_temporary>
253
+  </component>
254
+  <component name="SvnConfiguration">
255
+    <configuration />
256
+  </component>
257
+  <component name="TaskManager">
258
+    <task active="true" id="Default" summary="Default task">
259
+      <changelist id="ccd5c7b2-1d27-4aed-afad-474eb9d95589" name="Default Changelist" comment="" />
260
+      <created>1544050087465</created>
261
+      <option name="number" value="Default" />
262
+      <option name="presentableId" value="Default" />
263
+      <updated>1544050087465</updated>
264
+      <workItem from="1544050089666" duration="8031000" />
265
+      <workItem from="1544127693771" duration="21286000" />
266
+      <workItem from="1544392376310" duration="10767000" />
267
+    </task>
268
+    <servers />
269
+  </component>
270
+  <component name="TestHistory">
271
+    <history-entry file="ArrazTest_test1insertAtStartAndCopy - 2018.12.09 at 19h 44m 05s.xml">
272
+      <configuration name="ArrazTest.test1insertAtStartAndCopy" configurationId="JUnit" />
273
+    </history-entry>
274
+    <history-entry file="ArrazTest_test1insertAtStartAndCopy - 2018.12.09 at 19h 44m 54s.xml">
275
+      <configuration name="ArrazTest.test1insertAtStartAndCopy" configurationId="JUnit" />
276
+    </history-entry>
277
+    <history-entry file="ArrazTest_test1insertAtStartAndCopy - 2018.12.09 at 19h 45m 16s.xml">
278
+      <configuration name="ArrazTest.test1insertAtStartAndCopy" configurationId="JUnit" />
279
+    </history-entry>
280
+    <history-entry file="ArrazTest_test2insertAtStartAndCopy - 2018.12.09 at 19h 45m 20s.xml">
281
+      <configuration name="ArrazTest.test2insertAtStartAndCopy" configurationId="JUnit" />
282
+    </history-entry>
283
+    <history-entry file="All_in_arraz - 2018.12.09 at 19h 45m 32s.xml">
284
+      <configuration name="All in arraz" configurationId="JUnit" />
285
+    </history-entry>
286
+    <history-entry file="ArrazTest_test1insertAtEndAndCopy - 2018.12.09 at 19h 50m 41s.xml">
287
+      <configuration name="ArrazTest.test1insertAtEndAndCopy" configurationId="JUnit" />
288
+    </history-entry>
289
+    <history-entry file="ArrazTest_test2insertAtEndAndCopy - 2018.12.09 at 19h 50m 45s.xml">
290
+      <configuration name="ArrazTest.test2insertAtEndAndCopy" configurationId="JUnit" />
291
+    </history-entry>
292
+    <history-entry file="ArrazTest_test1sortArrayIntoEvensThenOdds - 2018.12.09 at 20h 11m 12s.xml">
293
+      <configuration name="ArrazTest.test1sortArrayIntoEvensThenOdds" configurationId="JUnit" />
294
+    </history-entry>
295
+    <history-entry file="ArrazTest_test2sortArrayIntoEvensThenOdds - 2018.12.09 at 20h 12m 11s.xml">
296
+      <configuration name="ArrazTest.test2sortArrayIntoEvensThenOdds" configurationId="JUnit" />
297
+    </history-entry>
298
+    <history-entry file="All_in_arraz - 2018.12.09 at 20h 12m 18s.xml">
299
+      <configuration name="All in arraz" configurationId="JUnit" />
300
+    </history-entry>
301
+  </component>
302
+  <component name="TimeTrackingManager">
303
+    <option name="totallyTimeSpent" value="40084000" />
304
+  </component>
305
+  <component name="ToolWindowManager">
306
+    <frame x="0" y="0" width="1440" height="900" extended-state="0" />
307
+    <editor active="true" />
308
+    <layout>
309
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2532189" />
310
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
311
+      <window_info id="Designer" order="2" />
312
+      <window_info id="Image Layers" order="3" />
313
+      <window_info id="Capture Tool" order="4" />
314
+      <window_info id="UI Designer" order="5" />
315
+      <window_info id="Favorites" order="6" side_tool="true" />
316
+      <window_info anchor="bottom" id="Message" order="0" />
317
+      <window_info anchor="bottom" id="Find" order="1" />
318
+      <window_info anchor="bottom" id="Run" order="2" weight="0.32891566" />
319
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
320
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
321
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
322
+      <window_info anchor="bottom" id="TODO" order="6" />
323
+      <window_info anchor="bottom" id="Terminal" order="7" />
324
+      <window_info anchor="bottom" id="Docker" order="8" show_stripe_button="false" />
325
+      <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
326
+      <window_info anchor="bottom" id="Messages" order="10" weight="0.32891566" />
327
+      <window_info anchor="bottom" id="Database Changes" order="11" />
328
+      <window_info anchor="bottom" id="Version Control" order="12" />
329
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
330
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
331
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
332
+      <window_info anchor="right" id="Maven" order="3" />
333
+      <window_info anchor="right" id="Palette" order="4" />
334
+      <window_info anchor="right" id="Capture Analysis" order="5" />
335
+      <window_info anchor="right" id="Database" order="6" />
336
+      <window_info anchor="right" id="Palette&#9;" order="7" />
337
+      <window_info anchor="right" id="Theme Preview" order="8" />
338
+      <window_info anchor="right" id="Coverage" order="9" side_tool="true" weight="0.3297568" />
339
+    </layout>
340
+  </component>
341
+  <component name="TypeScriptGeneratedFilesManager">
342
+    <option name="version" value="1" />
343
+  </component>
344
+  <component name="editorHistoryManager">
345
+    <entry file="file://$PROJECT_DIR$/pom.xml">
346
+      <provider selected="true" editor-type-id="text-editor">
347
+        <state relative-caret-position="195">
348
+          <caret line="13" column="25" selection-start-line="13" selection-start-column="25" selection-end-line="13" selection-end-column="25" />
349
+        </state>
350
+      </provider>
351
+    </entry>
352
+    <entry file="file://$PROJECT_DIR$/src/main/java/OddEven.java">
353
+      <provider selected="true" editor-type-id="text-editor">
354
+        <state relative-caret-position="255">
355
+          <caret line="17" column="8" lean-forward="true" selection-start-line="17" selection-start-column="8" selection-end-line="17" selection-end-column="8" />
356
+          <folding>
357
+            <element signature="e#456#457#0" expanded="true" />
358
+            <element signature="e#483#484#0" expanded="true" />
359
+            <element signature="e#512#513#0" expanded="true" />
360
+            <element signature="e#540#541#0" expanded="true" />
361
+          </folding>
362
+        </state>
363
+      </provider>
364
+    </entry>
365
+    <entry file="file://$PROJECT_DIR$/src/test/java/OddEvenTest.java">
366
+      <provider selected="true" editor-type-id="text-editor">
367
+        <state relative-caret-position="356">
368
+          <caret line="28" column="38" lean-forward="true" selection-start-line="28" selection-start-column="38" selection-end-line="29" />
369
+          <folding>
370
+            <element signature="imports" expanded="true" />
371
+          </folding>
372
+        </state>
373
+      </provider>
374
+    </entry>
375
+    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/org/junit/Assert.class">
376
+      <provider selected="true" editor-type-id="text-editor">
377
+        <state relative-caret-position="177">
378
+          <caret line="333" selection-start-line="333" selection-end-line="333" />
379
+        </state>
380
+      </provider>
381
+    </entry>
382
+    <entry file="file://$PROJECT_DIR$/src/test/java/MaxMinTest.java">
383
+      <provider selected="true" editor-type-id="text-editor">
384
+        <state relative-caret-position="360">
385
+          <caret line="24" column="26" selection-start-line="24" selection-start-column="26" selection-end-line="24" selection-end-column="26" />
386
+          <folding>
387
+            <element signature="imports" expanded="true" />
388
+          </folding>
389
+        </state>
390
+      </provider>
391
+    </entry>
392
+    <entry file="file://$PROJECT_DIR$/src/main/java/MaxMin.java">
393
+      <provider selected="true" editor-type-id="text-editor">
394
+        <state relative-caret-position="225">
395
+          <caret line="15" column="9" selection-start-line="15" selection-start-column="9" selection-end-line="15" selection-end-column="9" />
396
+          <folding>
397
+            <element signature="e#413#414#0" expanded="true" />
398
+            <element signature="e#439#440#0" expanded="true" />
399
+          </folding>
400
+        </state>
401
+      </provider>
402
+    </entry>
403
+    <entry file="file://$PROJECT_DIR$/src/test/java/SmallestFirstAndSecondTest.java">
404
+      <provider selected="true" editor-type-id="text-editor">
405
+        <state relative-caret-position="270">
406
+          <caret line="24" column="24" selection-start-line="24" selection-start-column="24" selection-end-line="24" selection-end-column="24" />
407
+          <folding>
408
+            <element signature="imports" expanded="true" />
409
+          </folding>
410
+        </state>
411
+      </provider>
412
+    </entry>
413
+    <entry file="file://$PROJECT_DIR$/src/main/java/SmallestFirstAndSecond.java">
414
+      <provider selected="true" editor-type-id="text-editor">
415
+        <state relative-caret-position="195">
416
+          <caret line="13" column="9" selection-start-line="13" selection-start-column="9" selection-end-line="13" selection-end-column="9" />
417
+          <folding>
418
+            <element signature="e#732#733#0" expanded="true" />
419
+            <element signature="e#807#808#0" expanded="true" />
420
+          </folding>
421
+        </state>
422
+      </provider>
423
+    </entry>
424
+    <entry file="file://$PROJECT_DIR$/src/main/java/Arraz.java">
425
+      <provider selected="true" editor-type-id="text-editor">
426
+        <state relative-caret-position="648">
427
+          <caret line="229" column="29" lean-forward="true" selection-start-line="229" selection-start-column="29" selection-end-line="229" selection-end-column="29" />
428
+          <folding>
429
+            <element signature="imports" expanded="true" />
430
+            <element signature="e#3449#3450#0" expanded="true" />
431
+            <element signature="e#3497#3498#0" expanded="true" />
432
+            <element signature="e#3562#3563#0" expanded="true" />
433
+            <element signature="e#3623#3624#0" expanded="true" />
434
+            <element signature="e#4537#4538#0" expanded="true" />
435
+            <element signature="e#4610#4611#0" expanded="true" />
436
+            <element signature="e#4890#4891#0" expanded="true" />
437
+            <element signature="e#4931#4932#0" expanded="true" />
438
+            <element signature="e#6397#6406#0" expanded="true" />
439
+            <element signature="e#6464#6473#0" expanded="true" />
440
+          </folding>
441
+        </state>
442
+      </provider>
443
+    </entry>
444
+    <entry file="file://$PROJECT_DIR$/src/test/java/ArrazTest.java">
445
+      <provider selected="true" editor-type-id="text-editor">
446
+        <state relative-caret-position="5348">
447
+          <caret line="655" column="18" selection-start-line="655" selection-start-column="18" selection-end-line="655" selection-end-column="18" />
448
+          <folding>
449
+            <element signature="imports" expanded="true" />
450
+          </folding>
451
+        </state>
452
+      </provider>
453
+    </entry>
454
+  </component>
455
+  <component name="masterDetails">
456
+    <states>
457
+      <state key="GlobalLibrariesConfigurable.UI">
458
+        <settings>
459
+          <splitter-proportions>
460
+            <option name="proportions">
461
+              <list>
462
+                <option value="0.2" />
463
+              </list>
464
+            </option>
465
+          </splitter-proportions>
466
+        </settings>
467
+      </state>
468
+      <state key="JdkListConfigurable.UI">
469
+        <settings>
470
+          <last-edited>1.8</last-edited>
471
+          <splitter-proportions>
472
+            <option name="proportions">
473
+              <list>
474
+                <option value="0.2" />
475
+              </list>
476
+            </option>
477
+          </splitter-proportions>
478
+        </settings>
479
+      </state>
480
+      <state key="ProjectJDKs.UI">
481
+        <settings>
482
+          <last-edited>1.8</last-edited>
483
+          <splitter-proportions>
484
+            <option name="proportions">
485
+              <list>
486
+                <option value="0.2" />
487
+              </list>
488
+            </option>
489
+          </splitter-proportions>
490
+        </settings>
491
+      </state>
492
+      <state key="ProjectLibrariesConfigurable.UI">
493
+        <settings>
494
+          <splitter-proportions>
495
+            <option name="proportions">
496
+              <list>
497
+                <option value="0.2" />
498
+              </list>
499
+            </option>
500
+          </splitter-proportions>
501
+        </settings>
502
+      </state>
503
+    </states>
504
+  </component>
505
+</project>

+ 4
- 4
arraz/arraz.iml Datei anzeigen

@@ -1,16 +1,16 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
3
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6">
4 4
     <output url="file://$MODULE_DIR$/target/classes" />
5 5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
6 6
     <content url="file://$MODULE_DIR$">
7 7
       <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9 8
       <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
10 9
       <excludeFolder url="file://$MODULE_DIR$/target" />
11 10
     </content>
12
-    <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
11
+    <orderEntry type="inheritedJdk" />
13 12
     <orderEntry type="sourceFolder" forTests="false" />
14
-    <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" />
15 15
   </component>
16 16
 </module>

+ 13
- 1
arraz/pom.xml Datei anzeigen

@@ -7,11 +7,23 @@
7 7
     <groupId>rocks.zipcode.arraysgonewild</groupId>
8 8
     <artifactId>arraz</artifactId>
9 9
     <version>1.0-SNAPSHOT</version>
10
+    <build>
11
+        <plugins>
12
+            <plugin>
13
+                <groupId>org.apache.maven.plugins</groupId>
14
+                <artifactId>maven-compiler-plugin</artifactId>
15
+                <configuration>
16
+                    <source>6</source>
17
+                    <target>6</target>
18
+                </configuration>
19
+            </plugin>
20
+        </plugins>
21
+    </build>
10 22
     <dependencies>
11 23
         <dependency>
12 24
             <groupId>junit</groupId>
13 25
             <artifactId>junit</artifactId>
14
-            <version>4.0</version>
26
+            <version>4.12</version>
15 27
         </dependency>
16 28
     </dependencies>
17 29
 

+ 231
- 1
arraz/src/main/java/Arraz.java Datei anzeigen

@@ -1,2 +1,232 @@
1
-public class Arraz {
1
+import java.lang.reflect.Array;
2
+import java.util.ArrayList;
3
+import java.util.Arrays;
4
+import java.util.Iterator;
5
+import java.util.List;
6
+import java.util.Set;
7
+import java.util.TreeSet;
8
+
9
+public class Arraz<E> {
10
+
11
+    public int sumValuesOfArray(int[] ints) {
12
+        int sum = 0;
13
+        for (int x : ints) {
14
+            sum += x;
15
+        }
16
+        return sum;
17
+    }
18
+
19
+    public double sumDoublesOfArray(double[] doubles) {
20
+        double sum = 0;
21
+        for (double x : doubles) {
22
+            sum += x;
23
+        }
24
+        return sum;
25
+    }
26
+
27
+    public int averageOfArray(int[] ints) {
28
+        return sumValuesOfArray(ints) / ints.length;
29
+    }
30
+
31
+    public double doubleAverageOfArray(double[] doubles) {
32
+        return sumDoublesOfArray(doubles) / doubles.length;
33
+    }
34
+
35
+    public boolean containsValue(int[] ints, int i) {
36
+        for (int x : ints) {
37
+            if (x == i) {
38
+                return true;
39
+            }
40
+        }
41
+        return false;
42
+    }
43
+
44
+    public int[] reverseArray(int[] ints) {
45
+        int[] reversedArray = new int[ints.length];
46
+        for (int i = ints.length - 1, j = 0; i >= 0; i--, j++) {
47
+            reversedArray[j] = ints[i];
48
+        }
49
+        return reversedArray;
50
+    }
51
+
52
+
53
+    public int findIndexOf(E[] array, E element) {
54
+        for (int i = 0; i < array.length; i++) {
55
+            if (array[i].equals(element)) {
56
+                return i;
57
+            }
58
+        }
59
+        return -1;
60
+    }
61
+
62
+    public E[] copyArrayByInterator(E[] array) {
63
+        E[] copyOfArray = (E[]) new Object[array.length];
64
+        List<E> list = new ArrayList<E>(array.length);
65
+        list.addAll(Arrays.asList(array));
66
+        Iterator iterator = list.iterator();
67
+        int index = 0;
68
+        while (iterator.hasNext()) {
69
+            copyOfArray[index] = (E) iterator.next();
70
+            index++;
71
+        }
72
+        return copyOfArray;
73
+    }
74
+
75
+    public E[] copyArrayByLoop(E[] array) {
76
+        E[] copyOfArray = (E[]) new Object[array.length];
77
+        for (int i = 0; i < array.length; i++) {
78
+            copyOfArray[i] = array[i];
79
+        }
80
+        return copyOfArray;
81
+    }
82
+
83
+    public E[] removeElementFromArray(E[] array, E element) {
84
+        E[] updatedArray = (E[]) new Object[array.length - 1];
85
+        for (int i = 0, j = 0; i < array.length; i++, j++) {
86
+            if (!array[i].equals(element)) {
87
+                updatedArray[j] = array[i];
88
+            } else {
89
+                j--;
90
+            }
91
+        }
92
+        return updatedArray;
93
+    }
94
+
95
+    public E[] insertIntoArrayAt(E[] array, int index, E element) {
96
+        E[] updatedArray = (E[]) new Object[array.length + 1];
97
+        for (int i = 0, j = 0; j < updatedArray.length; i++, j++) {
98
+            if (j != index) {
99
+                updatedArray[j] = array[i];
100
+            } else {
101
+                updatedArray[j] = element;
102
+                i--;
103
+            }
104
+        }
105
+        return updatedArray;
106
+    }
107
+
108
+    public Integer[] removeDupesFromArray(Integer[] ints) {
109
+        Set<Integer> integerSet = new TreeSet<Integer>();
110
+        integerSet.addAll(Arrays.asList(ints));
111
+        return integerSet.toArray(new Integer[0]);
112
+    }
113
+
114
+    public double find2ndLargestValueFromArray(double[] doubles) {
115
+        double max = 0;
116
+        double secondLargest = 0;
117
+        for (double x : doubles) if (x > max) max = x;
118
+        for (double y : doubles) if (y > secondLargest && y < max) secondLargest = y;
119
+        return secondLargest;
120
+    }
121
+
122
+    public E[] makeMeAnArrayFromArrayList(ArrayList<E> arrayList) {
123
+        return (E[]) arrayList.toArray();
124
+    }
125
+
126
+    public ArrayList<E> makeMeAnArrayListFromArray(E[] array) {
127
+        return new ArrayList<E>(Arrays.asList(array));
128
+    }
129
+
130
+    public boolean check2ArraysForEqual(E[] x, E[] y) {
131
+        if (x.length == y.length) {
132
+            for (int i = 0; i < x.length; i++) {
133
+                if (!x[i].equals(y[i])) {
134
+                    return false;
135
+                }
136
+            }
137
+        } else {
138
+            return false;
139
+        }
140
+        return true;
141
+    }
142
+
143
+    public int averageArrayWithoutMaxMin(int[] ints) {
144
+        MaxMin maxMin = new MaxMin(0,0);
145
+        maxMin.findMaxMinOfArray(ints);
146
+        int max = maxMin.getMax();
147
+        int min = maxMin.getMin();
148
+        int[] updatedArray = new int[ints.length - 2];
149
+        for (int i = 0, j = 0; i < ints.length; i++, j++) {
150
+            if (ints[i] != max && ints[i] != min) {
151
+                updatedArray[j] = ints[i];
152
+            } else {
153
+                j--;
154
+            }
155
+        }
156
+        return averageOfArray(updatedArray);
157
+    }
158
+
159
+    public boolean arrayHas65and77(int[] ints) {
160
+        return containsValue(ints, 65) && containsValue(ints, 77);
161
+    }
162
+
163
+    public boolean theTotalofTensIs30(int[] ints) {
164
+        int sumOfTens = 0;
165
+        for (int i : ints) {
166
+            if (i == 10) {
167
+                sumOfTens += i;
168
+            }
169
+        }
170
+        return sumOfTens == 30;
171
+    }
172
+
173
+    public int[] makeMeACopyPlease(int[] ints) {
174
+        return reverseArray(ints);
175
+    }
176
+
177
+    public E[] removeLastItemAndCopy(E[] elements) {
178
+        E[] updatedElements = (E[]) new Object[elements.length - 1];
179
+        for (int i = 0; i < updatedElements.length; i++) {
180
+            updatedElements[i] = elements[i];
181
+        }
182
+        return updatedElements;
183
+    }
184
+
185
+    public E[] removeFirstItemAndCopy(E[] elements) {
186
+        E[] updatedElements = (E[]) new Object[elements.length - 1];
187
+        for (int i = 1, j = 0; j < updatedElements.length; i++, j++) {
188
+            updatedElements[j] = elements[i];
189
+        }
190
+        return updatedElements;
191
+    }
192
+
193
+    public E[] insertAtStartAndCopy(E[] elements, E element) {
194
+        E[] updatedElements = (E[]) new Object[elements.length + 1];
195
+        updatedElements[0] = element;
196
+        for (int i = 0, j = 1; j < updatedElements.length; i++, j++) {
197
+            updatedElements[j] = elements[i];
198
+        }
199
+        return updatedElements;
200
+    }
201
+
202
+    public E[] insertAtEndAndCopy(E[] elements, E element) {
203
+        E[] updatedElements = (E[]) new Object[elements.length + 1];
204
+        for (int i = 0; i < elements.length; i++) {
205
+            updatedElements[i] = elements[i];
206
+        }
207
+        updatedElements[updatedElements.length - 1] = element;
208
+        return updatedElements;
209
+    }
210
+
211
+    public Integer[] sortArrayIntoEvensThenOdds(Integer[] integers) {
212
+        Integer[] updatedIntegers = new Integer[integers.length];
213
+        ArrayList<Integer> evenIntegers = new ArrayList<Integer>();
214
+        ArrayList<Integer> oddIntegers = new ArrayList<Integer>();
215
+        for (Integer i : integers) {
216
+            if (i % 2 == 0) {
217
+                evenIntegers.add(i);
218
+            } else {
219
+                oddIntegers.add(i);
220
+            }
221
+        }
222
+
223
+        for (int i = 0; i < evenIntegers.size(); i++) {
224
+            updatedIntegers[i] = evenIntegers.get(i);
225
+        }
226
+
227
+        for (int i = 0, j = evenIntegers.size(); i < oddIntegers.size(); i++, j++) {
228
+            updatedIntegers[j] = oddIntegers.get(i);
229
+        }
230
+        return updatedIntegers;
231
+    }
2 232
 }

+ 27
- 0
arraz/src/main/java/MaxMin.java Datei anzeigen

@@ -0,0 +1,27 @@
1
+public class MaxMin {
2
+    private int max = 0;
3
+    private int min = 0;
4
+
5
+    public MaxMin(int max, int min) {
6
+        this.max = max;
7
+        this.min = min;
8
+    }
9
+
10
+    public MaxMin findMaxMinOfArray(int[] ints) {
11
+        min = ints[0];
12
+        for (int i : ints) {
13
+            if (i < min) min = i;
14
+
15
+            if (i > max) max = i;
16
+        }
17
+        return new MaxMin(max, min);
18
+    }
19
+
20
+    public int getMax() {
21
+        return max;
22
+    }
23
+
24
+    public int getMin() {
25
+        return min;
26
+    }
27
+}

+ 28
- 0
arraz/src/main/java/OddEven.java Datei anzeigen

@@ -0,0 +1,28 @@
1
+public class OddEven {
2
+    public int odds = 0;
3
+    public int evens = 0;
4
+
5
+    public OddEven(int odds, int evens) {
6
+        this.odds = odds;
7
+        this.evens = evens;
8
+    }
9
+
10
+    public OddEven getOddEvensOfArray(int[] ints) {
11
+        for (int i : ints) {
12
+            if (i % 2 == 0) {
13
+                evens++;
14
+            } else {
15
+                odds++;
16
+            }
17
+        }
18
+        return new OddEven(odds, evens);
19
+    }
20
+
21
+    public int getOdds() {
22
+        return odds;
23
+    }
24
+
25
+    public int getEvens() {
26
+        return evens;
27
+    }
28
+}

+ 29
- 0
arraz/src/main/java/SmallestFirstAndSecond.java Datei anzeigen

@@ -0,0 +1,29 @@
1
+public class SmallestFirstAndSecond {
2
+    private int smallest = 0;
3
+    private int secondSmallest = 0;
4
+
5
+    public SmallestFirstAndSecond(int smallest, int secondSmallest) {
6
+        this.smallest = smallest;
7
+        this.secondSmallest = secondSmallest;
8
+    }
9
+
10
+    public SmallestFirstAndSecond findSmallestAndSecondSmallest(int[] ints) {
11
+        smallest = ints[0];
12
+        for (int i : ints) {
13
+            if (i < smallest) smallest = i;
14
+        }
15
+        secondSmallest = ints[1];
16
+        for (int i : ints) {
17
+            if (i < secondSmallest && i > smallest) secondSmallest = i;
18
+        }
19
+        return new SmallestFirstAndSecond(smallest, secondSmallest);
20
+    }
21
+
22
+    public int getSmallest() {
23
+        return smallest;
24
+    }
25
+
26
+    public int getSecondSmallest() {
27
+        return secondSmallest;
28
+    }
29
+}

+ 660
- 1
arraz/src/test/java/ArrazTest.java Datei anzeigen

@@ -1,5 +1,664 @@
1
-import static org.junit.Assert.*;
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+import java.util.ArrayList;
5
+
2 6
 
3 7
 public class ArrazTest {
8
+    Arraz arraz = new Arraz();
9
+
10
+    @Test
11
+    public void test1sumValuesOfArray() {
12
+        // Given
13
+        int[] x = {1, 2, 3, 4, 5};
14
+        int expected = x[0] + x[1] + x[2] + x[3] + x[4];
15
+
16
+        // When
17
+        int actual = arraz.sumValuesOfArray(x);
18
+
19
+        // Then
20
+        Assert.assertEquals(expected, actual);
21
+    }
22
+
23
+    @Test
24
+    public void test2sumValuesOfArray() {
25
+        // Given
26
+        int[] y = {99, 88, 77, 66, 55};
27
+        int expected = y[0] + y[1] + y[2] + y[3] + y[4];
28
+
29
+        // When
30
+        int actual = arraz.sumValuesOfArray(y);
31
+
32
+        // Then
33
+        Assert.assertEquals(expected, actual);
34
+
35
+    }
36
+
37
+    @Test
38
+    public void test1sumDoublesOfArray() {
39
+        // Given
40
+        double[] x = {1.1, 2.2, 3.3, 4.4, 5.5};
41
+        double expected = x[0] + x[1] + x[2] + x[3] + x[4];
42
+
43
+        // When
44
+        double actual = arraz.sumDoublesOfArray(x);
45
+
46
+        // Then
47
+        Assert.assertEquals(expected, actual, 0.01);
48
+    }
49
+
50
+    @Test
51
+    public void test2sumDoublesOfArray() {
52
+        // Given
53
+        double[] y = {99.1, 88.2, 77.3, 66.4, 55.5};
54
+        double expected = y[0] + y[1] + y[2] + y[3] + y[4];
55
+
56
+        // When
57
+        double actual = arraz.sumDoublesOfArray(y);
58
+
59
+        // Then
60
+        Assert.assertEquals(expected, actual, 0.01);
61
+    }
62
+
63
+    @Test
64
+    public void test1averageOfArray() {
65
+        // Given
66
+        int[] x = {1, 2, 3, 4, 5};
67
+        int expected = (x[0] + x[1] + x[2] + x[3] + x[4]) / x.length;
68
+
69
+        // When
70
+        int actual = arraz.averageOfArray(x);
71
+
72
+        // Then
73
+        Assert.assertEquals(expected, actual);
74
+    }
75
+
76
+    @Test
77
+    public void test2averageOfArray() {
78
+        // Given
79
+        int[] y = {7, 4, 13, 19, 7};
80
+        int expected = (y[0] + y[1] + y[2] + y[3] + y[4]) / y.length;
81
+
82
+        // When
83
+        int actual = arraz.averageOfArray(y);
84
+
85
+        // Then
86
+        Assert.assertEquals(expected, actual);
87
+    }
88
+
89
+    @Test
90
+    public void test1doubleAverageOfArray() {
91
+        // Given
92
+        double[] x = {11.7, 4.4, 8.13, 6.19};
93
+        double expected = (x[0] + x[1] + x[2] + x[3]) / x.length;
94
+
95
+        // When
96
+        double actual = arraz.doubleAverageOfArray(x);
97
+
98
+        // Then
99
+        Assert.assertEquals(expected, actual, 0.01);
100
+    }
101
+
102
+    @Test
103
+    public void test2doubleAverageOfArray() {
104
+        // Given
105
+        double[] y = {19.81, 19.88, 20.10, 20.15};
106
+        double expected = (y[0] + y[1] + y[2] + y[3]) / y.length;
107
+
108
+        // When
109
+        double actual = arraz.doubleAverageOfArray(y);
110
+
111
+        // Then
112
+        Assert.assertEquals(expected, actual, 0.01);
113
+    }
114
+
115
+    @Test
116
+    public void test1containsValue() {
117
+        // Given
118
+        int[] x = {1, 2, 3, 4, 5};
119
+        int y = 3;
120
+
121
+        // When
122
+        boolean actual = arraz.containsValue(x, y);
123
+
124
+        // Then
125
+        Assert.assertTrue(actual);
126
+    }
127
+
128
+    @Test
129
+    public void test2containsValue() {
130
+        // Given
131
+        int[] x = {7, 4, 13, 19, 7};
132
+        int y = 99;
133
+
134
+        // When
135
+        boolean actual = arraz.containsValue(x, y);
136
+
137
+        // Then
138
+        Assert.assertFalse(actual);
139
+    }
140
+
141
+    @Test
142
+    public void test1reverseArray() {
143
+        // Given
144
+        int[] y = {7, 4, 13, 19, 7};
145
+        int[] expected = {y[4], y[3], y[2], y[1], y[0]};
146
+
147
+        // When
148
+        int[] actual = arraz.reverseArray(y);
149
+
150
+        // Then
151
+        Assert.assertArrayEquals(expected, actual);
152
+    }
153
+
154
+    @Test
155
+    public void test2reverseArray() {
156
+        // Given
157
+        int[] x = {11, 22, 33, 44, 55};
158
+        int[] expected = {x[4], x[3], x[2], x[1], x[0]};
159
+
160
+        // When
161
+        int[] actual = arraz.reverseArray(x);
162
+
163
+        // Then
164
+        Assert.assertArrayEquals(expected, actual);
165
+    }
166
+
167
+    @Test
168
+    public void test1findIndexOf() {
169
+        // Given
170
+        Integer[] x = {9, 8, 7, 6, 5};
171
+        int expected = 2;
172
+
173
+        // When
174
+        int actual = arraz.findIndexOf(x, 7);
175
+
176
+        // Then
177
+        Assert.assertEquals(expected, actual);
178
+
179
+
180
+    }
181
+
182
+    @Test
183
+    public void test2findIndexOf() {
184
+        // Given
185
+        String[] y = {"Curtis", "Caleb", "Liam"};
186
+        int expected = -1;
187
+
188
+        // When
189
+        int actual = arraz.findIndexOf(y, "Ashley");
190
+
191
+        // Then
192
+        Assert.assertEquals(expected, actual);
193
+    }
194
+
195
+    @Test
196
+    public void test1copyArrayByInterator() {
197
+        // Given
198
+        Double[] expected = {1234.56, 45.67, 8.9};
199
+
200
+        // When
201
+        Object[] actual = arraz.copyArrayByInterator(expected);
202
+
203
+        // Then
204
+        Assert.assertArrayEquals(expected, actual);
205
+    }
206
+
207
+    @Test
208
+    public void test2copyArrayByInterator() {
209
+        // Given
210
+        String[] expected = {"Curtis", "Caleb", "Liam"};
211
+
212
+        // When
213
+        Object[] actual = arraz.copyArrayByInterator(expected);
214
+
215
+        // Then
216
+        Assert.assertArrayEquals(expected, actual);
217
+    }
218
+
219
+    @Test
220
+    public void test1copyArrayByLoop() {
221
+        // Given
222
+        Double[] expected = {1234.56, 45.67, 8.9};
223
+
224
+        // When
225
+        Object[] actual = arraz.copyArrayByLoop(expected);
226
+
227
+        // Then
228
+        Assert.assertArrayEquals(expected, actual);
229
+    }
230
+
231
+    @Test
232
+    public void test2copyArrayByLoop() {
233
+        // Given
234
+        String[] expected = {"Curtis", "Caleb", "Liam"};
235
+
236
+        // When
237
+        Object[] actual = arraz.copyArrayByLoop(expected);
238
+
239
+        // Then
240
+        Assert.assertArrayEquals(expected, actual);
241
+    }
242
+
243
+    @Test
244
+    public void test1removeElementFromArray() {
245
+        // Given
246
+        String[] x = {"Brian", "Damon", "Greg", "Ed"};
247
+        String[] expected = {"Brian", "Damon", "Ed"};
248
+
249
+        // When
250
+        Object[] actual = arraz.removeElementFromArray(x, "Greg");
251
+
252
+        // Then
253
+        Assert.assertArrayEquals(expected, actual);
254
+    }
255
+
256
+    @Test
257
+    public void test2removeElementFromArray() {
258
+        // Given
259
+        Character[] x = {'b', 'd', 'e', 'g'};
260
+        Character[] expected = {'b', 'd', 'e'};
261
+
262
+        // When
263
+        Object[] actual = arraz.removeElementFromArray(x, 'g');
264
+
265
+        // Then
266
+        Assert.assertArrayEquals(expected, actual);
267
+    }
268
+
269
+
270
+    @Test
271
+    public void test1insertIntoArrayAt() {
272
+        // Given
273
+        Character[] x = {'b', 'd', 'e'};
274
+        Character[] expected = {'b', 'd', 'e', 'g'};
275
+
276
+        // When
277
+        Object[] actual = arraz.insertIntoArrayAt(x, 3, 'g');
278
+
279
+        // Then
280
+        Assert.assertArrayEquals(expected, actual);
281
+    }
282
+
283
+    @Test
284
+    public void test2insertIntoArrayAt() {
285
+        // Given
286
+        Integer[] y = {1, 2, 4, 5, 6};
287
+        Integer[] expected = {1, 2, 3, 4, 5, 6};
288
+
289
+        // When
290
+        Object[] actual = arraz.insertIntoArrayAt(y, 2, 3);
291
+
292
+        // Then
293
+        Assert.assertArrayEquals(expected, actual);
294
+    }
295
+
296
+    @Test
297
+    public void test1removeDupesFromArray() {
298
+        // Given
299
+        Integer[] x = {11, 22, 33, 44, 11, 44};
300
+        Integer[] expected = {11, 22, 33, 44};
301
+
302
+        // When
303
+        Integer[] actual = arraz.removeDupesFromArray(x);
304
+
305
+        // Then
306
+        Assert.assertArrayEquals(expected, actual);
307
+    }
308
+
309
+    @Test
310
+    public void test2removeDupesFromArray() {
311
+        // Given
312
+        Integer[] y = {5, 6, 7, 8, 7, 6, 5};
313
+        Integer[] expected = {5, 6, 7, 8};
314
+
315
+        // When
316
+        Integer[] actual = arraz.removeDupesFromArray(y);
317
+
318
+        // Then
319
+        Assert.assertArrayEquals(expected, actual);
320
+
321
+    }
322
+
323
+    @Test
324
+    public void test1find2ndLargestValueFromArray() {
325
+        // Given
326
+        double[] x = {11.22, 33.44, 55.66};
327
+        double expected = 33.44;
328
+
329
+        // When
330
+        double actual = arraz.find2ndLargestValueFromArray(x);
331
+
332
+        // Then
333
+        Assert.assertEquals(expected, actual, 0.01);
334
+    }
335
+
336
+    @Test
337
+    public void test2find2ndLargestValueFromArray() {
338
+        // Given
339
+        double[] y = {0.03, 0.3, 0.1, 0.98};
340
+        double expected = 0.3;
341
+
342
+        // When
343
+        double actual = arraz.find2ndLargestValueFromArray(y);
344
+
345
+        // Then
346
+        Assert.assertEquals(expected, actual, 0.01);
347
+    }
348
+
349
+    @Test
350
+    public void test1makeMeAnArrayFromArrayList() {
351
+        // Given
352
+        ArrayList<String> x = new ArrayList<String>();
353
+        x.add("Curtis");
354
+        x.add("Caleb");
355
+        x.add("Liam");
356
+        String[] expected = {"Curtis", "Caleb", "Liam"};
357
+
358
+        // When
359
+        Object[] actual = arraz.makeMeAnArrayFromArrayList(x);
360
+
361
+        // Then
362
+        Assert.assertArrayEquals(expected, actual);
363
+    }
364
+
365
+    @Test
366
+    public void test2makeMeAnArrayFromArrayList() {
367
+        // Given
368
+        ArrayList<Character> y = new ArrayList<Character>();
369
+        y.add('A');
370
+        y.add('b');
371
+        y.add('C');
372
+        y.add('d');
373
+        Character[] expected = {'A', 'b', 'C', 'd'};
374
+
375
+        // When
376
+        Object[] actual = arraz.makeMeAnArrayFromArrayList(y);
377
+
378
+        // Then
379
+        Assert.assertArrayEquals(expected, actual);
380
+    }
381
+
382
+    @Test
383
+    public void test1makeMeAnArrayListFromArray() {
384
+        // Given
385
+        Double[] x = {11.11, 22.22, 33.33};
386
+        ArrayList<Double> expected = new ArrayList<Double>();
387
+        expected.add(11.11);
388
+        expected.add(22.22);
389
+        expected.add(33.33);
390
+
391
+        // When
392
+        ArrayList<Double> actual = arraz.makeMeAnArrayListFromArray(x);
393
+
394
+        // Then
395
+        Assert.assertEquals(expected, actual);
396
+    }
397
+
398
+    @Test
399
+    public void test2makeMeAnArrayListFromArray() {
400
+        // Given
401
+        Integer[] y = {234, 987, 100, 77};
402
+        ArrayList<Integer> expected = new ArrayList<Integer>();
403
+        expected.add(234);
404
+        expected.add(987);
405
+        expected.add(100);
406
+        expected.add(77);
407
+
408
+        // When
409
+        ArrayList<Integer> actual = arraz.makeMeAnArrayListFromArray(y);
410
+
411
+        // Then
412
+        Assert.assertEquals(expected, actual);
413
+    }
414
+
415
+    @Test
416
+    public void test1check2ArraysForEqual() {
417
+        // Given
418
+        Integer[] x = {1, 2, 3, 4, 5};
419
+        Integer[] y = {5, 4, 3, 2, 1};
420
+
421
+        // Then
422
+        Assert.assertFalse(arraz.check2ArraysForEqual(x, y));
423
+    }
424
+
425
+    @Test
426
+    public void test2check2ArraysForEqual() {
427
+        // Given
428
+        String[] x = {"Curtis", "Caleb", "Lionel"};
429
+        String[] y = {"Curtis", "Caleb", "Lionel"};
430
+
431
+        // Then
432
+        Assert.assertTrue(arraz.check2ArraysForEqual(x, y));
433
+    }
434
+
435
+    @Test
436
+    public void test1averageArrayWithoutMaxMin() {
437
+        // Given
438
+        int[] x = {1, 2, 3, 4, 5};
439
+        int expected = (2 + 3 + 4) / (x.length - 2);
440
+
441
+        // When
442
+        int actual = arraz.averageArrayWithoutMaxMin(x);
443
+
444
+        // Then
445
+        Assert.assertEquals(expected, actual);
446
+    }
447
+
448
+    @Test
449
+    public void test2averageArrayWithoutMaxMin() {
450
+        // Given
451
+        int[] y = {99, 88, 77, 66, 55};
452
+        int expected =(88 + 77 + 66) / (y.length - 2);
453
+
454
+        // When
455
+        int actual = arraz.averageArrayWithoutMaxMin(y);
456
+
457
+        // Then
458
+        Assert.assertEquals(expected, actual);
459
+    }
460
+
461
+    @Test
462
+    public void test1arrayHas65and77() {
463
+        // Given
464
+        int[] x = {98, 76, 54, 32};
465
+
466
+        // When
467
+        boolean actual = arraz.arrayHas65and77(x);
468
+
469
+        // Then
470
+        Assert.assertFalse(actual);
471
+    }
472
+
473
+    @Test
474
+    public void test2arrayHas65and77() {
475
+        // Given
476
+        int[] y = {65, 77};
477
+
478
+        // When
479
+        boolean actual = arraz.arrayHas65and77(y);
480
+
481
+        // Then
482
+        Assert.assertTrue(actual);
483
+    }
484
+
485
+    @Test
486
+    public void test1theTotalofTensIs30() {
487
+        // Given
488
+        int[] x = {10, 20, 10, 30, 10};
489
+
490
+        // When
491
+        boolean actual = arraz.theTotalofTensIs30(x);
492
+
493
+        // Then
494
+        Assert.assertTrue(actual);
495
+    }
496
+
497
+    @Test
498
+    public void test2theTotalofTensIs30() {
499
+        // Given
500
+        int[] y = {10, 20, 30, 40, 50};
501
+
502
+        // When
503
+        boolean actual = arraz.theTotalofTensIs30(y);
504
+
505
+        // Then
506
+        Assert.assertFalse(actual);
507
+    }
508
+
509
+    @Test
510
+    public void test1makeMeACopyPlease() {
511
+        // Given
512
+        int[] x = {1, 3, 5, 7};
513
+        int[] expected = {7, 5, 3, 1};
514
+
515
+        // When
516
+        int[] actual = arraz.makeMeACopyPlease(x);
517
+
518
+        // Then
519
+        Assert.assertArrayEquals(expected, actual);
520
+    }
521
+
522
+    @Test
523
+    public void test2makeMeACopyPlease() {
524
+        // Given
525
+        int[] y = {7, 5, 3, 1};
526
+        int[] expected = {1, 3, 5, 7};
527
+
528
+        // When
529
+        int[] actual = arraz.makeMeACopyPlease(y);
530
+
531
+        // Then
532
+        Assert.assertArrayEquals(expected, actual);
533
+    }
534
+
535
+    @Test
536
+    public void test1removeLastItemAndCopy() {
537
+        // Given
538
+        Double[] x = {0.01, 0.1, 1.0};
539
+        Double[] expected = {0.01, 0.1};
540
+
541
+        // When
542
+        Object[] actual = arraz.removeLastItemAndCopy(x);
543
+
544
+        // Then
545
+        Assert.assertArrayEquals(expected, actual);
546
+    }
547
+
548
+    @Test
549
+    public void test2removeLastItemAndCopy() {
550
+        // Given
551
+        String[] y = {"Curtis", "Caleb", "Liam", "Ashley"};
552
+        String[] expected = {"Curtis", "Caleb", "Liam"};
553
+
554
+        // When
555
+        Object[] actual = arraz.removeLastItemAndCopy(y);
556
+
557
+        // Then
558
+        Assert.assertArrayEquals(expected, actual);
559
+    }
560
+
561
+    @Test
562
+    public void test1removeFirstItemAndCopy() {
563
+        // Given
564
+        Double[] x = {0.01, 0.1, 1.0};
565
+        Double[] expected = {0.1, 1.0};
566
+
567
+        // When
568
+        Object[] actual = arraz.removeFirstItemAndCopy(x);
569
+
570
+        // Then
571
+        Assert.assertArrayEquals(expected, actual);
572
+    }
573
+
574
+    @Test
575
+    public void test2removeFirstItemAndCopy() {
576
+        // Given
577
+        String[] y = {"Curtis", "Caleb", "Liam", "Ashley"};
578
+        String[] expected = {"Caleb", "Liam", "Ashley"};
579
+
580
+        // When
581
+        Object[] actual = arraz.removeFirstItemAndCopy(y);
582
+
583
+        // Then
584
+        Assert.assertArrayEquals(expected, actual);
585
+    }
586
+
587
+    @Test
588
+    public void test1insertAtStartAndCopy() {
589
+        // Given
590
+        Integer[] x = {1, 2, 3, 4, 5};
591
+        Integer[] expected = {0, 1, 2, 3, 4, 5};
592
+
593
+        // When
594
+        Object[] actual = arraz.insertAtStartAndCopy(x, 0);
595
+
596
+        // Then
597
+        Assert.assertArrayEquals(expected, actual);
598
+    }
599
+
600
+    @Test
601
+    public void test2insertAtStartAndCopy() {
602
+        // Given
603
+        String[] y = {"Caleb", "Liam"};
604
+        String[] expected = {"Curtis", "Caleb", "Liam"};
605
+
606
+        // When
607
+        Object[] actual = arraz.insertAtStartAndCopy(y, "Curtis");
608
+
609
+        // Then
610
+        Assert.assertArrayEquals(expected, actual);
611
+    }
612
+
613
+    @Test
614
+    public void test1insertAtEndAndCopy() {
615
+        // Given
616
+        Double[] x = {11.11, 22.22, 33.33};
617
+        Double[] expected = {11.11, 22.22, 33.33, 44.44};
618
+
619
+        // When
620
+        Object[] actual = arraz.insertAtEndAndCopy(x, 44.44);
621
+
622
+        // Then
623
+        Assert.assertArrayEquals(expected, actual);
624
+    }
625
+
626
+    @Test
627
+    public void test2insertAtEndAndCopy() {
628
+        // Given
629
+        String[] y = {"Curtis", "Caleb", "Liam"};
630
+        String[] expected = {"Curtis", "Caleb", "Liam", "Ashley"};
631
+
632
+        // When
633
+        Object[] actual = arraz.insertAtEndAndCopy(y, "Ashley");
634
+
635
+        // Then
636
+        Assert.assertArrayEquals(expected, actual);
637
+    }
638
+
639
+    @Test
640
+    public void test1sortArrayIntoEvensThenOdds() {
641
+        // Given
642
+        Integer[] x = {1, 2, 3, 4, 5, 6, 7, 8};
643
+        Integer[] expected = {2, 4, 6, 8, 1, 3, 5, 7};
644
+
645
+        // When
646
+        Object[] actual = arraz.sortArrayIntoEvensThenOdds(x);
647
+
648
+        // Then
649
+        Assert.assertArrayEquals(expected, actual);
650
+    }
651
+
652
+    @Test
653
+    public void test2sortArrayIntoEvensThenOdds() {
654
+        // Given
655
+        Integer[] y = {11, 22, 33, 44};
656
+        Integer[]  expected = {22, 44, 11, 33};
657
+
658
+        // When
659
+        Object[] actual = arraz.sortArrayIntoEvensThenOdds(y);
4 660
 
661
+        // Then
662
+        Assert.assertArrayEquals(expected, actual);
663
+    }
5 664
 }

+ 34
- 0
arraz/src/test/java/MaxMinTest.java Datei anzeigen

@@ -0,0 +1,34 @@
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+public class MaxMinTest {
5
+    MaxMin maxMin = new MaxMin(0, 0);
6
+
7
+    @Test
8
+    public void test1findMaxMinOfArray() {
9
+        // Given
10
+        int[] x = {1, 3, 5, 7, 9};
11
+        int expected = 1;
12
+
13
+        // When
14
+        maxMin.findMaxMinOfArray(x);
15
+        int actual = maxMin.getMin();
16
+
17
+        // Then
18
+        Assert.assertEquals(expected, actual);
19
+    }
20
+
21
+    @Test
22
+    public void test2findMaxMinOfArray() {
23
+        // Given
24
+        int[] y = {2, 4, 6, 8, 10};
25
+        int expected = 10;
26
+
27
+        // When
28
+        maxMin.findMaxMinOfArray(y);
29
+        int actual = maxMin.getMax();
30
+
31
+        // Then
32
+        Assert.assertEquals(expected, actual);
33
+    }
34
+}

+ 35
- 0
arraz/src/test/java/OddEvenTest.java Datei anzeigen

@@ -0,0 +1,35 @@
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+public class OddEvenTest {
5
+
6
+    @Test
7
+    public void test1getOddEvensOfArray() {
8
+        // Given
9
+        int[] x = {1, 2, 3, 4, 5, 6, 7};
10
+        int expected = 3;
11
+        OddEven oddEven = new OddEven(0, 0);
12
+
13
+        // When
14
+        oddEven.getOddEvensOfArray(x);
15
+        int actual = oddEven.getEvens();
16
+
17
+        // Then
18
+        Assert.assertEquals(expected, actual);
19
+    }
20
+
21
+    @Test
22
+    public void test2getOddEvensOfArray() {
23
+        // Given
24
+        int[] y = {11, 7, 8, 13, 6, 19, 4, 4};
25
+        int expected = 4;
26
+        OddEven oddEven = new OddEven(0, 0);
27
+
28
+        // When
29
+        oddEven.getOddEvensOfArray(y);
30
+        int actual = oddEven.getOdds();
31
+
32
+        // Then
33
+        Assert.assertEquals(expected, actual);
34
+    }
35
+}

+ 34
- 0
arraz/src/test/java/SmallestFirstAndSecondTest.java Datei anzeigen

@@ -0,0 +1,34 @@
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+public class SmallestFirstAndSecondTest {
5
+    SmallestFirstAndSecond smallestFirstAndSecond = new SmallestFirstAndSecond(0, 0);
6
+
7
+    @Test
8
+    public void test1findSmallestAndSecondSmallest() {
9
+        // Given
10
+        int[] x = {1, 234, 5, 678, 9};
11
+        int expected = 1;
12
+
13
+        // When
14
+        smallestFirstAndSecond.findSmallestAndSecondSmallest(x);
15
+        int actual = smallestFirstAndSecond.getSmallest();
16
+
17
+        // Then
18
+        Assert.assertEquals(expected, actual);
19
+    }
20
+
21
+    @Test
22
+    public void test2findSmallestAndSecondSmallest() {
23
+        // Given
24
+        int[] y = {1, 234, 5, 678, 9};
25
+        int expected = 5;
26
+
27
+        // When
28
+        smallestFirstAndSecond.findSmallestAndSecondSmallest(y);
29
+        int actual = smallestFirstAndSecond.getSecondSmallest();
30
+
31
+        // Then
32
+        Assert.assertEquals(expected, actual);
33
+    }
34
+}