Quellcode durchsuchen

working on part 10

ThuyKhong vor 6 Jahren
Ursprung
Commit
f5d7421d42

+ 1
- 0
.idea/.name Datei anzeigen

@@ -0,0 +1 @@
1
+interfaces-1

+ 16
- 0
.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="interfaces-1" />
10
+      </profile>
11
+    </annotationProcessing>
12
+    <bytecodeTargetLevel>
13
+      <module name="interfaces-1" target="1.5" />
14
+    </bytecodeTargetLevel>
15
+  </component>
16
+</project>

+ 6
- 0
.idea/encodings.xml Datei anzeigen

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="Encoding">
4
+    <file url="file://$PROJECT_DIR$" charset="UTF-8" />
5
+  </component>
6
+</project>

+ 13
- 0
.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
.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
.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
.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$/interfaces-1.iml" filepath="$PROJECT_DIR$/interfaces-1.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
.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>

+ 690
- 0
.idea/workspace.xml Datei anzeigen

@@ -0,0 +1,690 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="ea6021b7-c295-4b5a-ab14-0c95741c5e4a" name="Default Changelist" comment="">
5
+      <change beforePath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestPerson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestPerson.java" afterDir="false" />
7
+    </list>
8
+    <ignored path="$PROJECT_DIR$/target/" />
9
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
10
+    <option name="SHOW_DIALOG" value="false" />
11
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
12
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
13
+    <option name="LAST_RESOLUTION" value="IGNORE" />
14
+  </component>
15
+  <component name="FUSProjectUsageTrigger">
16
+    <session id="2041875192">
17
+      <usages-collector id="statistics.lifecycle.project">
18
+        <counts>
19
+          <entry key="project.open.time.0" value="1" />
20
+          <entry key="project.opened" value="1" />
21
+        </counts>
22
+      </usages-collector>
23
+      <usages-collector id="statistics.file.extensions.open">
24
+        <counts>
25
+          <entry key="java" value="19" />
26
+        </counts>
27
+      </usages-collector>
28
+      <usages-collector id="statistics.file.types.open">
29
+        <counts>
30
+          <entry key="JAVA" value="19" />
31
+        </counts>
32
+      </usages-collector>
33
+      <usages-collector id="statistics.file.extensions.edit">
34
+        <counts>
35
+          <entry key="java" value="5968" />
36
+        </counts>
37
+      </usages-collector>
38
+      <usages-collector id="statistics.file.types.edit">
39
+        <counts>
40
+          <entry key="JAVA" value="5968" />
41
+        </counts>
42
+      </usages-collector>
43
+    </session>
44
+  </component>
45
+  <component name="FileEditorManager">
46
+    <leaf>
47
+      <file pinned="false" current-in-tab="false">
48
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Student.java">
49
+          <provider selected="true" editor-type-id="text-editor">
50
+            <state relative-caret-position="30">
51
+              <caret line="2" column="13" selection-start-line="2" selection-start-column="13" selection-end-line="2" selection-end-column="13" />
52
+              <folding>
53
+                <element signature="e#99#100#0" expanded="true" />
54
+                <element signature="e#124#125#0" expanded="true" />
55
+                <element signature="e#225#226#0" expanded="true" />
56
+                <element signature="e#289#290#0" expanded="true" />
57
+                <element signature="e#329#330#0" expanded="true" />
58
+                <element signature="e#366#367#0" expanded="true" />
59
+              </folding>
60
+            </state>
61
+          </provider>
62
+        </entry>
63
+      </file>
64
+      <file pinned="false" current-in-tab="false">
65
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentsTest.java">
66
+          <provider selected="true" editor-type-id="text-editor">
67
+            <state relative-caret-position="269">
68
+              <caret line="20" column="51" selection-start-line="20" selection-start-column="8" selection-end-line="20" selection-end-column="51" />
69
+              <folding>
70
+                <element signature="imports" expanded="true" />
71
+              </folding>
72
+            </state>
73
+          </provider>
74
+        </entry>
75
+      </file>
76
+      <file pinned="false" current-in-tab="false">
77
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Instructors.java">
78
+          <provider selected="true" editor-type-id="text-editor">
79
+            <state relative-caret-position="225">
80
+              <caret line="15" column="65" selection-start-line="15" selection-start-column="65" selection-end-line="15" selection-end-column="65" />
81
+              <folding>
82
+                <element signature="e#229#241#0" expanded="true" />
83
+                <element signature="e#713#714#0" expanded="true" />
84
+                <element signature="e#744#745#0" expanded="true" />
85
+              </folding>
86
+            </state>
87
+          </provider>
88
+        </entry>
89
+      </file>
90
+      <file pinned="false" current-in-tab="false">
91
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorsTest.java">
92
+          <provider selected="true" editor-type-id="text-editor">
93
+            <state relative-caret-position="75">
94
+              <caret line="5" column="30" lean-forward="true" selection-start-line="5" selection-start-column="30" selection-end-line="5" selection-end-column="30" />
95
+              <folding>
96
+                <element signature="imports" expanded="true" />
97
+              </folding>
98
+            </state>
99
+          </provider>
100
+        </entry>
101
+      </file>
102
+      <file pinned="false" current-in-tab="false">
103
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/ZipCodeWilmingtonTest.java">
104
+          <provider selected="true" editor-type-id="text-editor">
105
+            <state relative-caret-position="255">
106
+              <caret line="17" lean-forward="true" selection-start-line="17" selection-end-line="17" />
107
+            </state>
108
+          </provider>
109
+        </entry>
110
+      </file>
111
+      <file pinned="false" current-in-tab="false">
112
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/ZipCodeWilmington.java">
113
+          <provider selected="true" editor-type-id="text-editor">
114
+            <state relative-caret-position="255">
115
+              <caret line="17" lean-forward="true" selection-start-line="17" selection-end-line="17" />
116
+            </state>
117
+          </provider>
118
+        </entry>
119
+      </file>
120
+      <file pinned="false" current-in-tab="true">
121
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/People.java">
122
+          <provider selected="true" editor-type-id="text-editor">
123
+            <state relative-caret-position="90">
124
+              <caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
125
+              <folding>
126
+                <element signature="e#141#149#0" expanded="true" />
127
+                <element signature="e#189#190#0" expanded="true" />
128
+                <element signature="e#227#228#0" expanded="true" />
129
+                <element signature="e#255#256#0" expanded="true" />
130
+                <element signature="e#295#296#0" expanded="true" />
131
+                <element signature="e#335#336#0" expanded="true" />
132
+                <element signature="e#376#377#0" expanded="true" />
133
+                <element signature="e#410#411#0" expanded="true" />
134
+                <element signature="e#447#448#0" expanded="true" />
135
+                <element signature="e#1086#1087#0" expanded="true" />
136
+                <element signature="e#1138#1139#0" expanded="true" />
137
+              </folding>
138
+            </state>
139
+          </provider>
140
+        </entry>
141
+      </file>
142
+      <file pinned="false" current-in-tab="false">
143
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Learner.java">
144
+          <provider selected="true" editor-type-id="text-editor">
145
+            <state relative-caret-position="30">
146
+              <caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
147
+            </state>
148
+          </provider>
149
+        </entry>
150
+      </file>
151
+      <file pinned="false" current-in-tab="false">
152
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Students.java">
153
+          <provider selected="true" editor-type-id="text-editor">
154
+            <state relative-caret-position="809">
155
+              <caret line="54" lean-forward="true" selection-start-line="54" selection-end-line="54" />
156
+              <folding>
157
+                <element signature="e#210#219#0" expanded="true" />
158
+                <element signature="e#203#204#0" expanded="true" />
159
+                <element signature="e#232#233#0" expanded="true" />
160
+              </folding>
161
+            </state>
162
+          </provider>
163
+        </entry>
164
+      </file>
165
+      <file pinned="false" current-in-tab="false">
166
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Teacher.java">
167
+          <provider selected="true" editor-type-id="text-editor">
168
+            <state relative-caret-position="30">
169
+              <caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
170
+            </state>
171
+          </provider>
172
+        </entry>
173
+      </file>
174
+    </leaf>
175
+  </component>
176
+  <component name="FileTemplateManagerImpl">
177
+    <option name="RECENT_TEMPLATES">
178
+      <list>
179
+        <option value="Interface" />
180
+        <option value="Class" />
181
+      </list>
182
+    </option>
183
+  </component>
184
+  <component name="Git.Settings">
185
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
186
+  </component>
187
+  <component name="IdeDocumentHistory">
188
+    <option name="CHANGED_PATHS">
189
+      <list>
190
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestPerson.java" />
191
+        <option value="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java" />
192
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Learner.java" />
193
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Teacher.java" />
194
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentTest.java" />
195
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorTest.java" />
196
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/PeopleTest.java" />
197
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentsTest.java" />
198
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Student.java" />
199
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Students.java" />
200
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Instructor.java" />
201
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorsTest.java" />
202
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Instructors.java" />
203
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/ZipCodeWilmingtonTest.java" />
204
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/ZipCodeWilmington.java" />
205
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/People.java" />
206
+      </list>
207
+    </option>
208
+  </component>
209
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
210
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
211
+  <component name="JsGulpfileManager">
212
+    <detection-done>true</detection-done>
213
+    <sorting>DEFINITION_ORDER</sorting>
214
+  </component>
215
+  <component name="ProjectFrameBounds">
216
+    <option name="x" value="511" />
217
+    <option name="y" value="23" />
218
+    <option name="width" value="1393" />
219
+    <option name="height" value="797" />
220
+  </component>
221
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true">
222
+    <ConfirmationsSetting value="1" id="Add" />
223
+  </component>
224
+  <component name="ProjectView">
225
+    <navigator proportions="" version="1">
226
+      <foldersAlwaysOnTop value="true" />
227
+    </navigator>
228
+    <panes>
229
+      <pane id="Scope" />
230
+      <pane id="PackagesPane" />
231
+      <pane id="ProjectPane">
232
+        <subPane>
233
+          <expand>
234
+            <path>
235
+              <item name="interfaces-1" type="b2602c69:ProjectViewProjectNode" />
236
+              <item name="CR-MacroLabs-OOP-InstructorStudentClassroom" type="462c0819:PsiDirectoryNode" />
237
+            </path>
238
+            <path>
239
+              <item name="interfaces-1" type="b2602c69:ProjectViewProjectNode" />
240
+              <item name="CR-MacroLabs-OOP-InstructorStudentClassroom" type="462c0819:PsiDirectoryNode" />
241
+              <item name="src" type="462c0819:PsiDirectoryNode" />
242
+            </path>
243
+            <path>
244
+              <item name="interfaces-1" type="b2602c69:ProjectViewProjectNode" />
245
+              <item name="CR-MacroLabs-OOP-InstructorStudentClassroom" type="462c0819:PsiDirectoryNode" />
246
+              <item name="src" type="462c0819:PsiDirectoryNode" />
247
+              <item name="main" type="462c0819:PsiDirectoryNode" />
248
+            </path>
249
+            <path>
250
+              <item name="interfaces-1" type="b2602c69:ProjectViewProjectNode" />
251
+              <item name="CR-MacroLabs-OOP-InstructorStudentClassroom" type="462c0819:PsiDirectoryNode" />
252
+              <item name="src" type="462c0819:PsiDirectoryNode" />
253
+              <item name="main" type="462c0819:PsiDirectoryNode" />
254
+              <item name="java" type="462c0819:PsiDirectoryNode" />
255
+            </path>
256
+            <path>
257
+              <item name="interfaces-1" type="b2602c69:ProjectViewProjectNode" />
258
+              <item name="CR-MacroLabs-OOP-InstructorStudentClassroom" type="462c0819:PsiDirectoryNode" />
259
+              <item name="src" type="462c0819:PsiDirectoryNode" />
260
+              <item name="main" type="462c0819:PsiDirectoryNode" />
261
+              <item name="java" type="462c0819:PsiDirectoryNode" />
262
+              <item name="interfaces" type="462c0819:PsiDirectoryNode" />
263
+            </path>
264
+            <path>
265
+              <item name="interfaces-1" type="b2602c69:ProjectViewProjectNode" />
266
+              <item name="CR-MacroLabs-OOP-InstructorStudentClassroom" type="462c0819:PsiDirectoryNode" />
267
+              <item name="src" type="462c0819:PsiDirectoryNode" />
268
+              <item name="test" type="462c0819:PsiDirectoryNode" />
269
+            </path>
270
+            <path>
271
+              <item name="interfaces-1" type="b2602c69:ProjectViewProjectNode" />
272
+              <item name="CR-MacroLabs-OOP-InstructorStudentClassroom" type="462c0819:PsiDirectoryNode" />
273
+              <item name="src" type="462c0819:PsiDirectoryNode" />
274
+              <item name="test" type="462c0819:PsiDirectoryNode" />
275
+              <item name="java" type="462c0819:PsiDirectoryNode" />
276
+            </path>
277
+            <path>
278
+              <item name="interfaces-1" type="b2602c69:ProjectViewProjectNode" />
279
+              <item name="CR-MacroLabs-OOP-InstructorStudentClassroom" type="462c0819:PsiDirectoryNode" />
280
+              <item name="src" type="462c0819:PsiDirectoryNode" />
281
+              <item name="test" type="462c0819:PsiDirectoryNode" />
282
+              <item name="java" type="462c0819:PsiDirectoryNode" />
283
+              <item name="interfaces" type="462c0819:PsiDirectoryNode" />
284
+            </path>
285
+          </expand>
286
+          <select />
287
+        </subPane>
288
+      </pane>
289
+    </panes>
290
+  </component>
291
+  <component name="PropertiesComponent">
292
+    <property name="WebServerToolWindowFactoryState" value="false" />
293
+    <property name="aspect.path.notification.shown" value="true" />
294
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1541472858840" />
295
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
296
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
297
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
298
+  </component>
299
+  <component name="RunDashboard">
300
+    <option name="ruleStates">
301
+      <list>
302
+        <RuleState>
303
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
304
+        </RuleState>
305
+        <RuleState>
306
+          <option name="name" value="StatusDashboardGroupingRule" />
307
+        </RuleState>
308
+      </list>
309
+    </option>
310
+  </component>
311
+  <component name="RunManager" selected="JUnit.InstructorsTest">
312
+    <configuration name="InstructorsTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
313
+      <module name="interfaces-1" />
314
+      <extension name="coverage">
315
+        <pattern>
316
+          <option name="PATTERN" value="io.zipcoder.interfaces.*" />
317
+          <option name="ENABLED" value="true" />
318
+        </pattern>
319
+      </extension>
320
+      <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
321
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.InstructorsTest" />
322
+      <method v="2">
323
+        <option name="Make" enabled="true" />
324
+      </method>
325
+    </configuration>
326
+    <configuration name="PeopleTest.testFindById" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
327
+      <module name="interfaces-1" />
328
+      <extension name="coverage">
329
+        <pattern>
330
+          <option name="PATTERN" value="io.zipcoder.interfaces.*" />
331
+          <option name="ENABLED" value="true" />
332
+        </pattern>
333
+      </extension>
334
+      <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
335
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.PeopleTest" />
336
+      <option name="METHOD_NAME" value="testFindById" />
337
+      <option name="TEST_OBJECT" value="method" />
338
+      <method v="2">
339
+        <option name="Make" enabled="true" />
340
+      </method>
341
+    </configuration>
342
+    <configuration name="PeopleTest.testRemoveAll" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
343
+      <module name="interfaces-1" />
344
+      <extension name="coverage">
345
+        <pattern>
346
+          <option name="PATTERN" value="io.zipcoder.interfaces.*" />
347
+          <option name="ENABLED" value="true" />
348
+        </pattern>
349
+      </extension>
350
+      <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
351
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.PeopleTest" />
352
+      <option name="METHOD_NAME" value="testRemoveAll" />
353
+      <option name="TEST_OBJECT" value="method" />
354
+      <method v="2">
355
+        <option name="Make" enabled="true" />
356
+      </method>
357
+    </configuration>
358
+    <configuration name="StudentsTest.testInitializationSetupStudents" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
359
+      <module name="interfaces-1" />
360
+      <extension name="coverage">
361
+        <pattern>
362
+          <option name="PATTERN" value="io.zipcoder.interfaces.*" />
363
+          <option name="ENABLED" value="true" />
364
+        </pattern>
365
+      </extension>
366
+      <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
367
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.StudentsTest" />
368
+      <option name="METHOD_NAME" value="testInitializationSetupStudents" />
369
+      <option name="TEST_OBJECT" value="method" />
370
+      <method v="2">
371
+        <option name="Make" enabled="true" />
372
+      </method>
373
+    </configuration>
374
+    <configuration name="StudentsTest.testSingletonInstance" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
375
+      <module name="interfaces-1" />
376
+      <extension name="coverage">
377
+        <pattern>
378
+          <option name="PATTERN" value="io.zipcoder.interfaces.*" />
379
+          <option name="ENABLED" value="true" />
380
+        </pattern>
381
+      </extension>
382
+      <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
383
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.StudentsTest" />
384
+      <option name="METHOD_NAME" value="testSingletonInstance" />
385
+      <option name="TEST_OBJECT" value="method" />
386
+      <method v="2">
387
+        <option name="Make" enabled="true" />
388
+      </method>
389
+    </configuration>
390
+    <list>
391
+      <item itemvalue="JUnit.PeopleTest.testRemoveAll" />
392
+      <item itemvalue="JUnit.PeopleTest.testFindById" />
393
+      <item itemvalue="JUnit.StudentsTest.testSingletonInstance" />
394
+      <item itemvalue="JUnit.StudentsTest.testInitializationSetupStudents" />
395
+      <item itemvalue="JUnit.InstructorsTest" />
396
+    </list>
397
+    <recent_temporary>
398
+      <list>
399
+        <item itemvalue="JUnit.InstructorsTest" />
400
+        <item itemvalue="JUnit.StudentsTest.testInitializationSetupStudents" />
401
+        <item itemvalue="JUnit.StudentsTest.testSingletonInstance" />
402
+        <item itemvalue="JUnit.PeopleTest.testFindById" />
403
+        <item itemvalue="JUnit.PeopleTest.testRemoveAll" />
404
+      </list>
405
+    </recent_temporary>
406
+  </component>
407
+  <component name="SvnConfiguration">
408
+    <configuration />
409
+  </component>
410
+  <component name="TaskManager">
411
+    <task active="true" id="Default" summary="Default task">
412
+      <changelist id="ea6021b7-c295-4b5a-ab14-0c95741c5e4a" name="Default Changelist" comment="" />
413
+      <created>1541297116156</created>
414
+      <option name="number" value="Default" />
415
+      <option name="presentableId" value="Default" />
416
+      <updated>1541297116156</updated>
417
+      <workItem from="1541297117764" duration="19065000" />
418
+    </task>
419
+    <servers />
420
+  </component>
421
+  <component name="TestHistory">
422
+    <history-entry file="PeopleTest_testRemoveAll - 2018.11.04 at 14h 21m 40s.xml">
423
+      <configuration name="PeopleTest.testRemoveAll" configurationId="JUnit" />
424
+    </history-entry>
425
+    <history-entry file="PeopleTest_testRemoveAll - 2018.11.04 at 14h 22m 29s.xml">
426
+      <configuration name="PeopleTest.testRemoveAll" configurationId="JUnit" />
427
+    </history-entry>
428
+    <history-entry file="PeopleTest_testRemoveAll - 2018.11.04 at 14h 23m 14s.xml">
429
+      <configuration name="PeopleTest.testRemoveAll" configurationId="JUnit" />
430
+    </history-entry>
431
+    <history-entry file="PeopleTest_testRemoveAll - 2018.11.04 at 19h 36m 01s.xml">
432
+      <configuration name="PeopleTest.testRemoveAll" configurationId="JUnit" />
433
+    </history-entry>
434
+    <history-entry file="PeopleTest_testFindById - 2018.11.04 at 19h 46m 20s.xml">
435
+      <configuration name="PeopleTest.testFindById" configurationId="JUnit" />
436
+    </history-entry>
437
+    <history-entry file="PeopleTest_testFindById - 2018.11.04 at 19h 47m 23s.xml">
438
+      <configuration name="PeopleTest.testFindById" configurationId="JUnit" />
439
+    </history-entry>
440
+    <history-entry file="PeopleTest_testFindById - 2018.11.04 at 19h 48m 45s.xml">
441
+      <configuration name="PeopleTest.testFindById" configurationId="JUnit" />
442
+    </history-entry>
443
+    <history-entry file="StudentsTest_testSingletonInstance - 2018.11.04 at 20h 37m 32s.xml">
444
+      <configuration name="StudentsTest.testSingletonInstance" configurationId="JUnit" />
445
+    </history-entry>
446
+    <history-entry file="StudentsTest_testInitializationSetupStudents - 2018.11.04 at 21h 10m 35s.xml">
447
+      <configuration name="StudentsTest.testInitializationSetupStudents" configurationId="JUnit" />
448
+    </history-entry>
449
+    <history-entry file="InstructorsTest - 2018.11.04 at 21h 44m 41s.xml">
450
+      <configuration name="InstructorsTest" configurationId="JUnit" />
451
+    </history-entry>
452
+  </component>
453
+  <component name="TimeTrackingManager">
454
+    <option name="totallyTimeSpent" value="19065000" />
455
+  </component>
456
+  <component name="ToolWindowManager">
457
+    <frame x="358" y="28" width="1393" height="797" extended-state="0" />
458
+    <editor active="true" />
459
+    <layout>
460
+      <window_info id="Image Layers" />
461
+      <window_info id="Designer" />
462
+      <window_info id="UI Designer" />
463
+      <window_info id="Capture Tool" />
464
+      <window_info id="Favorites" side_tool="true" />
465
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.121391565" />
466
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
467
+      <window_info anchor="bottom" id="Messages" weight="0.32907802" />
468
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
469
+      <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
470
+      <window_info anchor="bottom" id="Terminal" />
471
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
472
+      <window_info anchor="bottom" id="Message" order="0" />
473
+      <window_info anchor="bottom" id="Find" order="1" weight="0.32907802" />
474
+      <window_info anchor="bottom" id="Run" order="2" weight="0.32907802" />
475
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
476
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
477
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
478
+      <window_info anchor="bottom" id="TODO" order="6" />
479
+      <window_info anchor="right" id="Palette" />
480
+      <window_info anchor="right" id="Theme Preview" />
481
+      <window_info anchor="right" id="Capture Analysis" />
482
+      <window_info anchor="right" id="Palette&#9;" />
483
+      <window_info anchor="right" id="Database" />
484
+      <window_info anchor="right" id="Maven Projects" />
485
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
486
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
487
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
488
+    </layout>
489
+  </component>
490
+  <component name="TypeScriptGeneratedFilesManager">
491
+    <option name="version" value="1" />
492
+  </component>
493
+  <component name="VcsContentAnnotationSettings">
494
+    <option name="myLimit" value="2678400000" />
495
+  </component>
496
+  <component name="editorHistoryManager">
497
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java">
498
+      <provider selected="true" editor-type-id="text-editor">
499
+        <state relative-caret-position="210">
500
+          <caret line="14" column="29" selection-start-line="14" selection-start-column="29" selection-end-line="14" selection-end-column="29" />
501
+          <folding>
502
+            <element signature="e#86#87#0" expanded="true" />
503
+            <element signature="e#113#114#0" expanded="true" />
504
+            <element signature="e#164#165#0" expanded="true" />
505
+            <element signature="e#189#190#0" expanded="true" />
506
+            <element signature="e#272#273#0" expanded="true" />
507
+            <element signature="e#312#313#0" expanded="true" />
508
+            <element signature="e#344#345#0" expanded="true" />
509
+          </folding>
510
+        </state>
511
+      </provider>
512
+    </entry>
513
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestPerson.java">
514
+      <provider selected="true" editor-type-id="text-editor">
515
+        <state relative-caret-position="300">
516
+          <caret line="20" column="37" selection-start-line="20" selection-start-column="37" selection-end-line="20" selection-end-column="37" />
517
+          <folding>
518
+            <element signature="imports" expanded="true" />
519
+          </folding>
520
+        </state>
521
+      </provider>
522
+    </entry>
523
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentTest.java">
524
+      <provider selected="true" editor-type-id="text-editor">
525
+        <state relative-caret-position="345">
526
+          <caret line="23" lean-forward="true" selection-start-line="23" selection-end-line="23" />
527
+          <folding>
528
+            <element signature="imports" expanded="true" />
529
+          </folding>
530
+        </state>
531
+      </provider>
532
+    </entry>
533
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorTest.java">
534
+      <provider selected="true" editor-type-id="text-editor">
535
+        <state relative-caret-position="156">
536
+          <caret line="30" column="44" selection-start-line="30" selection-start-column="8" selection-end-line="30" selection-end-column="44" />
537
+          <folding>
538
+            <element signature="imports" expanded="true" />
539
+          </folding>
540
+        </state>
541
+      </provider>
542
+    </entry>
543
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/PeopleTest.java">
544
+      <provider selected="true" editor-type-id="text-editor">
545
+        <state relative-caret-position="119">
546
+          <caret line="42" column="8" lean-forward="true" selection-start-line="42" selection-start-column="8" selection-end-line="43" selection-end-column="28" />
547
+          <folding>
548
+            <element signature="imports" expanded="true" />
549
+          </folding>
550
+        </state>
551
+      </provider>
552
+    </entry>
553
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Instructor.java">
554
+      <provider selected="true" editor-type-id="text-editor">
555
+        <state relative-caret-position="165">
556
+          <caret line="11" column="25" lean-forward="true" selection-start-line="11" selection-start-column="25" selection-end-line="11" selection-end-column="25" />
557
+          <folding>
558
+            <element signature="e#125#126#0" expanded="true" />
559
+            <element signature="e#150#151#0" expanded="true" />
560
+            <element signature="e#214#215#0" expanded="true" />
561
+            <element signature="e#236#237#0" expanded="true" />
562
+          </folding>
563
+        </state>
564
+      </provider>
565
+    </entry>
566
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/InstructorsTest.java">
567
+      <provider selected="true" editor-type-id="text-editor">
568
+        <state relative-caret-position="75">
569
+          <caret line="5" column="30" lean-forward="true" selection-start-line="5" selection-start-column="30" selection-end-line="5" selection-end-column="30" />
570
+          <folding>
571
+            <element signature="imports" expanded="true" />
572
+          </folding>
573
+        </state>
574
+      </provider>
575
+    </entry>
576
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Teacher.java">
577
+      <provider selected="true" editor-type-id="text-editor">
578
+        <state relative-caret-position="30">
579
+          <caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
580
+        </state>
581
+      </provider>
582
+    </entry>
583
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Students.java">
584
+      <provider selected="true" editor-type-id="text-editor">
585
+        <state relative-caret-position="809">
586
+          <caret line="54" lean-forward="true" selection-start-line="54" selection-end-line="54" />
587
+          <folding>
588
+            <element signature="e#210#219#0" expanded="true" />
589
+            <element signature="e#203#204#0" expanded="true" />
590
+            <element signature="e#232#233#0" expanded="true" />
591
+          </folding>
592
+        </state>
593
+      </provider>
594
+    </entry>
595
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/StudentsTest.java">
596
+      <provider selected="true" editor-type-id="text-editor">
597
+        <state relative-caret-position="269">
598
+          <caret line="20" column="51" selection-start-line="20" selection-start-column="8" selection-end-line="20" selection-end-column="51" />
599
+          <folding>
600
+            <element signature="imports" expanded="true" />
601
+          </folding>
602
+        </state>
603
+      </provider>
604
+    </entry>
605
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Learner.java">
606
+      <provider selected="true" editor-type-id="text-editor">
607
+        <state relative-caret-position="30">
608
+          <caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
609
+        </state>
610
+      </provider>
611
+    </entry>
612
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Student.java">
613
+      <provider selected="true" editor-type-id="text-editor">
614
+        <state relative-caret-position="30">
615
+          <caret line="2" column="13" selection-start-line="2" selection-start-column="13" selection-end-line="2" selection-end-column="13" />
616
+          <folding>
617
+            <element signature="e#99#100#0" expanded="true" />
618
+            <element signature="e#124#125#0" expanded="true" />
619
+            <element signature="e#225#226#0" expanded="true" />
620
+            <element signature="e#289#290#0" expanded="true" />
621
+            <element signature="e#329#330#0" expanded="true" />
622
+            <element signature="e#366#367#0" expanded="true" />
623
+          </folding>
624
+        </state>
625
+      </provider>
626
+    </entry>
627
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/Instructors.java">
628
+      <provider selected="true" editor-type-id="text-editor">
629
+        <state relative-caret-position="225">
630
+          <caret line="15" column="65" selection-start-line="15" selection-start-column="65" selection-end-line="15" selection-end-column="65" />
631
+          <folding>
632
+            <element signature="e#229#241#0" expanded="true" />
633
+            <element signature="e#713#714#0" expanded="true" />
634
+            <element signature="e#744#745#0" expanded="true" />
635
+          </folding>
636
+        </state>
637
+      </provider>
638
+    </entry>
639
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/ZipCodeWilmingtonTest.java">
640
+      <provider selected="true" editor-type-id="text-editor">
641
+        <state relative-caret-position="255">
642
+          <caret line="17" lean-forward="true" selection-start-line="17" selection-end-line="17" />
643
+        </state>
644
+      </provider>
645
+    </entry>
646
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/ZipCodeWilmington.java">
647
+      <provider selected="true" editor-type-id="text-editor">
648
+        <state relative-caret-position="255">
649
+          <caret line="17" lean-forward="true" selection-start-line="17" selection-end-line="17" />
650
+        </state>
651
+      </provider>
652
+    </entry>
653
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/People.java">
654
+      <provider selected="true" editor-type-id="text-editor">
655
+        <state relative-caret-position="90">
656
+          <caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
657
+          <folding>
658
+            <element signature="e#141#149#0" expanded="true" />
659
+            <element signature="e#189#190#0" expanded="true" />
660
+            <element signature="e#227#228#0" expanded="true" />
661
+            <element signature="e#255#256#0" expanded="true" />
662
+            <element signature="e#295#296#0" expanded="true" />
663
+            <element signature="e#335#336#0" expanded="true" />
664
+            <element signature="e#376#377#0" expanded="true" />
665
+            <element signature="e#410#411#0" expanded="true" />
666
+            <element signature="e#447#448#0" expanded="true" />
667
+            <element signature="e#1086#1087#0" expanded="true" />
668
+            <element signature="e#1138#1139#0" expanded="true" />
669
+          </folding>
670
+        </state>
671
+      </provider>
672
+    </entry>
673
+  </component>
674
+  <component name="masterDetails">
675
+    <states>
676
+      <state key="ProjectJDKs.UI">
677
+        <settings>
678
+          <last-edited>1.8</last-edited>
679
+          <splitter-proportions>
680
+            <option name="proportions">
681
+              <list>
682
+                <option value="0.2" />
683
+              </list>
684
+            </option>
685
+          </splitter-proportions>
686
+        </settings>
687
+      </state>
688
+    </states>
689
+  </component>
690
+</project>

+ 16
- 0
interfaces-1.iml Datei anzeigen

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

+ 17
- 0
src/main/java/io/zipcoder/interfaces/Person.java Datei anzeigen

@@ -1,5 +1,22 @@
1 1
 package io.zipcoder.interfaces;
2 2
 
3 3
 public class Person {
4
+    private final long ID;
5
+    private String name;
4 6
 
7
+    public Person(long ID){
8
+        this.ID = ID;
9
+    }
10
+
11
+    public long getID() {
12
+        return ID;
13
+    }
14
+
15
+    public String getName() {
16
+        return name;
17
+    }
18
+
19
+    public void setName(String name) {
20
+        this.name = name;
21
+    }
5 22
 }

+ 24
- 0
src/test/java/io/zipcoder/interfaces/Instructor.java Datei anzeigen

@@ -0,0 +1,24 @@
1
+package io.zipcoder.interfaces;
2
+
3
+public class Instructor extends Person implements Teacher{
4
+    private String name;
5
+
6
+    public Instructor(long ID) {
7
+        super(ID);
8
+    }
9
+
10
+    public Instructor(long ID, String name){
11
+        super(ID);
12
+        this.name = name;
13
+    }
14
+
15
+    public void teach(Learner learner, double numberOfHours) {
16
+        learner.learn(numberOfHours);
17
+    }
18
+
19
+    public void lecture(Learner[] learners, double numberOfHours) {
20
+        for (int i = 0; i < learners.length; i++) {
21
+            learners[i].learn(numberOfHours/learners.length);
22
+        }
23
+    }
24
+}

+ 42
- 0
src/test/java/io/zipcoder/interfaces/InstructorTest.java Datei anzeigen

@@ -0,0 +1,42 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class InstructorTest {
7
+    Student student = new Student(012345);
8
+    Student student2 = new Student(001234);
9
+    Learner[] learners = {student, student2};
10
+
11
+    Instructor instructor = new Instructor(000001);
12
+
13
+    @Test
14
+    public void testImplementation(){
15
+
16
+        Assert.assertTrue(instructor instanceof Teacher);
17
+    }
18
+
19
+    @Test
20
+    public void testInheritance(){
21
+
22
+        Assert.assertTrue(instructor instanceof Person);
23
+    }
24
+
25
+    @Test
26
+    public void testTeach(){
27
+        instructor.teach(student, 4.0);
28
+
29
+        double expected = 4.0;
30
+        double actual = student.getTotalStudyTime();
31
+        Assert.assertEquals(expected, actual, .0001);
32
+    }
33
+
34
+    @Test
35
+    public void testLecture(){
36
+
37
+        instructor.lecture(learners, 3.0);
38
+        double expected = 1.5;
39
+        double actual = student.getTotalStudyTime();
40
+        Assert.assertEquals(expected, actual, .0001);
41
+    }
42
+}

+ 33
- 0
src/test/java/io/zipcoder/interfaces/Instructors.java Datei anzeigen

@@ -0,0 +1,33 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import java.util.ArrayList;
4
+
5
+public final class Instructors extends People{
6
+
7
+    static final Instructors INSTANCE = new Instructors();
8
+    ArrayList<Instructor> instructorList = new ArrayList<Instructor>();
9
+
10
+    private Instructors(){
11
+        instructorList.add(new Instructor(01, "Nhu Nguyen"));
12
+        instructorList.add(new Instructor(02, "Froilan Miranda"));
13
+        instructorList.add(new Instructor(03, "Kristofer Younger"));
14
+        instructorList.add(new Instructor(04, "L. Dolio Durant"));
15
+        instructorList.add(new Instructor(05, "Leon Hunter"));
16
+        instructorList.add(new Instructor(06, "Wilhem Alcivar"));
17
+    }
18
+
19
+    public static Instructors getInstance(){
20
+        return INSTANCE;
21
+    }
22
+
23
+    public Person[] getArray() {
24
+        Person[] instructorArray = new Person[instructorList.size()];
25
+
26
+        for (int i = 0; i < instructorList.size(); i++) {
27
+            for (int j = 0; j < instructorArray.length; j++) {
28
+                instructorArray[i] = instructorList.get(i);
29
+            }
30
+        }
31
+        return instructorArray;
32
+    }
33
+}

+ 27
- 0
src/test/java/io/zipcoder/interfaces/InstructorsTest.java Datei anzeigen

@@ -0,0 +1,27 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class InstructorsTest {
7
+
8
+    @Test
9
+    public void testSingletonInstance(){
10
+
11
+        Instructors instance1 = Instructors.getInstance();
12
+        Instructors instance2 = Instructors.getInstance();
13
+
14
+        Assert.assertSame(instance1, instance2);
15
+    }
16
+
17
+    @Test
18
+    public void testInitializationSetupStudents(){
19
+
20
+        Instructors instructors = Instructors.getInstance();
21
+        Person[] instructorssArray = instructors.getArray();
22
+
23
+        int expected = 6;
24
+        int actual = instructorssArray.length;
25
+        Assert.assertEquals(expected, actual);
26
+    }
27
+}

+ 6
- 0
src/test/java/io/zipcoder/interfaces/Learner.java Datei anzeigen

@@ -0,0 +1,6 @@
1
+package io.zipcoder.interfaces;
2
+
3
+public interface Learner {
4
+
5
+    void learn (double numberOfHours);
6
+}

+ 51
- 0
src/test/java/io/zipcoder/interfaces/People.java Datei anzeigen

@@ -0,0 +1,51 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import java.util.ArrayList;
4
+
5
+public class People {
6
+    ArrayList<Person> personList = new ArrayList<Person>();
7
+
8
+
9
+    public void add(Person person){
10
+        personList.add(person);
11
+    }
12
+
13
+    public int getCount(){
14
+        return personList.size();
15
+    }
16
+
17
+    public void remove(Person person){
18
+        personList.remove(person);
19
+    }
20
+
21
+    public void remove(long ID){
22
+        personList.remove(ID);
23
+    }
24
+
25
+    public Person findById(long ID){
26
+        Person person = null;
27
+        for (int i = 0; i < personList.size(); i++) {
28
+            if (personList.get(i).equals(ID)){
29
+                person =  personList.get(i);
30
+                break;
31
+            }
32
+        }
33
+        return person;
34
+    }
35
+
36
+    public Person[] getArray(){
37
+        Person[] personArray = new Person[personList.size()];
38
+
39
+        for (int i = 0; i < personList.size(); i++) {
40
+            for (int j = 0; j < personArray.length; j++) {
41
+                personArray[i] = personList.get(i);
42
+            }
43
+        }
44
+        return personArray;
45
+    }
46
+
47
+    public void removeAll(){
48
+        personList = new ArrayList<Person>();
49
+    }
50
+
51
+}

+ 73
- 0
src/test/java/io/zipcoder/interfaces/PeopleTest.java Datei anzeigen

@@ -0,0 +1,73 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+import java.util.ArrayList;
7
+
8
+public class PeopleTest {
9
+    ArrayList<Person> personList = new ArrayList();
10
+    People people = new People();
11
+    Person person = new Person(00001);
12
+    Person anotherPerson = new Person(00002);
13
+    Person person2 = new Person(00003);
14
+
15
+    @Test
16
+    public void testAdd(){
17
+        int expected = 1;
18
+        people.add(person);
19
+        int actual = people.getCount();
20
+        Assert.assertEquals(expected, actual);
21
+    }
22
+
23
+    @Test
24
+    public void testRemoveByPerson(){
25
+        int expected = 1;
26
+        people.add(anotherPerson);
27
+        people.remove(person);
28
+        int actual = people.getCount();
29
+        Assert.assertEquals(expected, actual);
30
+    }
31
+
32
+    @Test
33
+    public void testRemoveById(){
34
+        int expected = 1;
35
+        people.add(person2);
36
+        people.remove(00001);
37
+        int actual = people.getCount();
38
+        Assert.assertEquals(expected, actual);
39
+    }
40
+
41
+    @Test
42
+    public void testFindById(){
43
+        people.add(person);
44
+        people.add(person2);
45
+        Person expected = person;
46
+
47
+        Person actual = people.findById(00001);
48
+        Assert.assertEquals(expected, actual);
49
+    }
50
+
51
+    @Test
52
+    public void testGetArray(){
53
+
54
+        people.add(person);
55
+        people.add(person2);
56
+        Person[] expected = {person, person2};
57
+
58
+        Person[] actual = people.getArray();
59
+        Assert.assertEquals(expected, actual);
60
+    }
61
+
62
+    @Test
63
+    public void testRemoveAll(){
64
+        people.add(person);
65
+        people.add(person2);
66
+        people.removeAll();
67
+        int expected = 0;
68
+        int actual = people.getCount();
69
+        Assert.assertEquals(expected, actual);
70
+    }
71
+
72
+
73
+}

+ 24
- 0
src/test/java/io/zipcoder/interfaces/Student.java Datei anzeigen

@@ -0,0 +1,24 @@
1
+package io.zipcoder.interfaces;
2
+
3
+public class Student extends Person implements Learner{
4
+    private double totalStudyTime;
5
+    private String name;
6
+
7
+    public Student(long ID) {
8
+        super(ID);
9
+    }
10
+
11
+    public Student(long ID, String name) {
12
+        super(ID);
13
+        this.name = name;
14
+    }
15
+
16
+    public void learn(double numberOfHours){
17
+        totalStudyTime = totalStudyTime + numberOfHours;
18
+    }
19
+
20
+    public double getTotalStudyTime(){
21
+        return totalStudyTime;
22
+    }
23
+}
24
+

+ 23
- 0
src/test/java/io/zipcoder/interfaces/StudentTest.java Datei anzeigen

@@ -0,0 +1,23 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class StudentTest {
7
+    Student student = new Student(012345);
8
+
9
+    @Test
10
+    public void testImplementation(){
11
+
12
+        Assert.assertTrue(student instanceof Person);
13
+    }
14
+
15
+    @Test
16
+    public void testLearn(){
17
+
18
+        student.learn(5.0);
19
+        double expected = 5.0;
20
+        double actual = student.getTotalStudyTime();
21
+        Assert.assertEquals(expected, actual, .001);
22
+    }
23
+}

+ 67
- 0
src/test/java/io/zipcoder/interfaces/Students.java Datei anzeigen

@@ -0,0 +1,67 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import java.util.ArrayList;
4
+
5
+public final class Students extends People{
6
+
7
+    static final Students INSTANCE = new Students();
8
+    ArrayList<Student> studentList = new ArrayList<Student>();
9
+
10
+    private Students(){
11
+        studentList.add(new Student(1, "Ned Redmond"));
12
+        studentList.add(new Student(2, "Seth Abrams"));
13
+        studentList.add(new Student(3, "Akeem Cherry"));
14
+        studentList.add(new Student(4, "Whitney Martinez"));
15
+        studentList.add(new Student(5, "Nira Parikh"));
16
+        studentList.add(new Student(6, "Connor Dunnigan"));
17
+        studentList.add(new Student(7, "Christian Sheridan"));
18
+        studentList.add(new Student(8, "Curtis Cook"));
19
+        studentList.add(new Student(9, "Nuridalia Hernandez"));
20
+        studentList.add(new Student(10, "Brandon DeFrancis"));
21
+        studentList.add(new Student(11, "De'Jon Johnson"));
22
+        studentList.add(new Student(12, "Demetrius Murray"));
23
+        studentList.add(new Student(13, "Elliott Stansbury"));
24
+        studentList.add(new Student(14, "Nathan Hall"));
25
+        studentList.add(new Student(15, "Jae Joson"));
26
+        studentList.add(new Student(16, "Jacob Anderson"));
27
+        studentList.add(new Student(17, "Jose Bedolla"));
28
+        studentList.add(new Student(18, "Jenn Chao"));
29
+        studentList.add(new Student(19, "Jennifer Tinkler"));
30
+        studentList.add(new Student(20, "Jonathan Hinds"));
31
+        studentList.add(new Student(21, "Jay Samuels"));
32
+        studentList.add(new Student(22, "Jevit Tith"));
33
+        studentList.add(new Student(23, "Lauren Green"));
34
+        studentList.add(new Student(24, "Kate Moore"));
35
+        studentList.add(new Student(25, "Michelle DiMarino"));
36
+        studentList.add(new Student(26, "Maggie Pierse"));
37
+        studentList.add(new Student(27, "Nick Satinover"));
38
+        studentList.add(new Student(28, "Chaitali Patel"));
39
+        studentList.add(new Student(29, "Yesoda Sanka"));
40
+        studentList.add(new Student(30, "Saurav Kamath"));
41
+        studentList.add(new Student(31, "Sam Bhutani"));
42
+        studentList.add(new Student(32, "Soujanya Buragapu"));
43
+        studentList.add(new Student(33, "Steffon Williams"));
44
+        studentList.add(new Student(34, "Zavon Malone"));
45
+        studentList.add(new Student(35, "Thuy Kong"));
46
+        studentList.add(new Student(36, "Thulasi Puppala"));
47
+        studentList.add(new Student(37, "Trinh Tong"));
48
+        studentList.add(new Student(38, "William Brown"));
49
+        studentList.add(new Student(39, "Xzavia Cuello"));
50
+    }
51
+
52
+    public static Students getInstance(){
53
+        return INSTANCE;
54
+    }
55
+
56
+    public Person[] getArray() {
57
+        Person[] StudentsArray = new Person[studentList.size()];
58
+
59
+        for (int i = 0; i < studentList.size(); i++) {
60
+            for (int j = 0; j < StudentsArray.length; j++) {
61
+                StudentsArray[i] = studentList.get(i);
62
+            }
63
+        }
64
+        return StudentsArray;
65
+    }
66
+
67
+}

+ 28
- 0
src/test/java/io/zipcoder/interfaces/StudentsTest.java Datei anzeigen

@@ -0,0 +1,28 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class StudentsTest {
7
+
8
+
9
+    @Test
10
+    public void testSingletonInstance(){
11
+
12
+        Students instance1 = Students.getInstance();
13
+        Students instance2 = Students.getInstance();
14
+
15
+        Assert.assertSame(instance1, instance2);
16
+    }
17
+
18
+    @Test
19
+    public void testInitializationSetupStudents(){
20
+
21
+        Students students = Students.getInstance();
22
+        Person[] studentsArray = students.getArray();
23
+
24
+        int expected = 39;
25
+        int actual = studentsArray.length;
26
+        Assert.assertEquals(expected, actual);
27
+    }
28
+}

+ 8
- 0
src/test/java/io/zipcoder/interfaces/Teacher.java Datei anzeigen

@@ -0,0 +1,8 @@
1
+package io.zipcoder.interfaces;
2
+
3
+public interface Teacher {
4
+
5
+    void teach(Learner learner, double numberOfHours);
6
+
7
+    void lecture(Learner[] learners, double numberOfHours);
8
+}

+ 20
- 0
src/test/java/io/zipcoder/interfaces/TestPerson.java Datei anzeigen

@@ -1,5 +1,25 @@
1 1
 package io.zipcoder.interfaces;
2 2
 
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
3 6
 public class TestPerson {
7
+    Person person = new Person(1000000);
8
+
9
+    @Test
10
+    public void testConstructor(){
11
+
12
+        long expected = 1000000;
13
+        long actual = person.getID();
14
+        Assert.assertEquals(expected, actual);
15
+    }
16
+
17
+    @Test
18
+    public void testSetAndGetName(){
4 19
 
20
+        String expected = "John Smith";
21
+        person.setName("John Smith");
22
+        String actual = person.getName();
23
+        Assert.assertEquals(expected, actual);
24
+    }
5 25
 }

+ 17
- 0
src/test/java/io/zipcoder/interfaces/ZipCodeWilmington.java Datei anzeigen

@@ -0,0 +1,17 @@
1
+package io.zipcoder.interfaces;
2
+
3
+public class ZipCodeWilmington {
4
+    private Student student;
5
+    private Instructors instructors;
6
+
7
+    static final ZipCodeWilmington INSTANCE = new ZipCodeWilmington();
8
+
9
+    public void hostLecture(Teacher teacher, double numberOfHours){
10
+        Students students = Students.getInstance();
11
+        teacher.lecture(students.getArray(), numberOfHours);
12
+    }
13
+
14
+    public void hostLecture(long ID, double numberOfHours){
15
+
16
+    }
17
+}

+ 19
- 0
src/test/java/io/zipcoder/interfaces/ZipCodeWilmingtonTest.java Datei anzeigen

@@ -0,0 +1,19 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import org.junit.Test;
4
+
5
+public class ZipCodeWilmingtonTest {
6
+    Student student = new Student(0001);
7
+    Instructor instructor = new Instructor(05);
8
+
9
+    @Test
10
+    public void testHostLecture(){
11
+
12
+        instructor.hostLecture(05, 2.5);
13
+        double actual = student.getTotalStudyTime();
14
+
15
+
16
+    }
17
+
18
+
19
+}