Seth 6 anos atrás
pai
commit
eaade35bd8
3 arquivos alterados com 112 adições e 68 exclusões
  1. 79
    68
      .idea/workspace.xml
  2. 15
    0
      arraz/src/main/java/Arraz.java
  3. 18
    0
      arraz/src/test/java/ArrazTest.java

+ 79
- 68
.idea/workspace.xml Ver arquivo

2
 <project version="4">
2
 <project version="4">
3
   <component name="ChangeListManager">
3
   <component name="ChangeListManager">
4
     <list default="true" id="3455511b-a100-4bbd-b07c-68f009bc8dbc" name="Default" comment="">
4
     <list default="true" id="3455511b-a100-4bbd-b07c-68f009bc8dbc" name="Default" comment="">
5
-      <change beforePath="$PROJECT_DIR$/.idea/ArraysGoneWild.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/ArraysGoneWild.iml" afterDir="false" />
6
-      <change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
7
-      <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
8
-      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
9
       <change beforePath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" afterDir="false" />
5
       <change beforePath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" afterDir="false" />
10
       <change beforePath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" afterDir="false" />
6
       <change beforePath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" afterDir="false" />
11
     </list>
7
     </list>
26
       </usages-collector>
22
       </usages-collector>
27
       <usages-collector id="statistics.file.types.edit">
23
       <usages-collector id="statistics.file.types.edit">
28
         <counts>
24
         <counts>
29
-          <entry key="JAVA" value="5174" />
25
+          <entry key="JAVA" value="5964" />
30
           <entry key="XML" value="3" />
26
           <entry key="XML" value="3" />
31
         </counts>
27
         </counts>
32
       </usages-collector>
28
       </usages-collector>
33
       <usages-collector id="statistics.file.types.open">
29
       <usages-collector id="statistics.file.types.open">
34
         <counts>
30
         <counts>
35
           <entry key="JAVA" value="2" />
31
           <entry key="JAVA" value="2" />
36
-          <entry key="XML" value="1" />
32
+          <entry key="XML" value="2" />
37
         </counts>
33
         </counts>
38
       </usages-collector>
34
       </usages-collector>
39
     </session>
35
     </session>
43
       <file pinned="false" current-in-tab="false">
39
       <file pinned="false" current-in-tab="false">
44
         <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
40
         <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
45
           <provider selected="true" editor-type-id="text-editor">
41
           <provider selected="true" editor-type-id="text-editor">
46
-            <state relative-caret-position="-902">
47
-              <caret line="109" column="50" selection-start-line="109" selection-start-column="50" selection-end-line="109" selection-end-column="50" />
42
+            <state relative-caret-position="358">
43
+              <caret line="209" selection-start-line="209" selection-end-line="209" />
48
               <folding>
44
               <folding>
49
                 <element signature="imports" expanded="true" />
45
                 <element signature="imports" expanded="true" />
50
                 <element signature="e#4388#4389#0" expanded="true" />
46
                 <element signature="e#4388#4389#0" expanded="true" />
54
           </provider>
50
           </provider>
55
         </entry>
51
         </entry>
56
       </file>
52
       </file>
57
-      <file pinned="false" current-in-tab="true">
53
+      <file pinned="false" current-in-tab="false">
58
         <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
54
         <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
59
           <provider selected="true" editor-type-id="text-editor">
55
           <provider selected="true" editor-type-id="text-editor">
60
             <state relative-caret-position="343">
56
             <state relative-caret-position="343">
61
-              <caret line="103" lean-forward="true" selection-start-line="103" selection-end-line="103" />
57
+              <caret line="113" column="13" selection-start-line="113" selection-start-column="13" selection-end-line="113" selection-end-column="13" />
62
               <folding>
58
               <folding>
63
                 <element signature="imports" expanded="true" />
59
                 <element signature="imports" expanded="true" />
64
               </folding>
60
               </folding>
66
           </provider>
62
           </provider>
67
         </entry>
63
         </entry>
68
       </file>
64
       </file>
69
-      <file pinned="false" current-in-tab="false">
65
+      <file pinned="false" current-in-tab="true">
70
         <entry file="file://$PROJECT_DIR$/README.md">
66
         <entry file="file://$PROJECT_DIR$/README.md">
71
           <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
67
           <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
72
             <state split_layout="SPLIT">
68
             <state split_layout="SPLIT">
73
-              <first_editor relative-caret-position="381">
74
-                <caret line="74" column="117" selection-start-line="74" selection-start-column="113" selection-end-line="74" selection-end-column="117" />
69
+              <first_editor relative-caret-position="306">
70
+                <caret line="69" column="5" lean-forward="true" selection-start-line="69" selection-start-column="5" selection-end-line="69" selection-end-column="5" />
75
               </first_editor>
71
               </first_editor>
76
               <second_editor />
72
               <second_editor />
77
             </state>
73
             </state>
124
         <option value="$PROJECT_DIR$/README.md" />
120
         <option value="$PROJECT_DIR$/README.md" />
125
         <option value="$PROJECT_DIR$/arraz/pom.xml" />
121
         <option value="$PROJECT_DIR$/arraz/pom.xml" />
126
         <option value="$PROJECT_DIR$/arraz/src/main/java/OddEven.java" />
122
         <option value="$PROJECT_DIR$/arraz/src/main/java/OddEven.java" />
127
-        <option value="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" />
128
         <option value="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" />
123
         <option value="$PROJECT_DIR$/arraz/src/main/java/Arraz.java" />
124
+        <option value="$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java" />
129
       </list>
125
       </list>
130
     </option>
126
     </option>
131
   </component>
127
   </component>
209
     <property name="GO_FMT" value="false" />
205
     <property name="GO_FMT" value="false" />
210
     <property name="WebServerToolWindowFactoryState" value="false" />
206
     <property name="WebServerToolWindowFactoryState" value="false" />
211
     <property name="aspect.path.notification.shown" value="true" />
207
     <property name="aspect.path.notification.shown" value="true" />
212
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544126310211" />
208
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544130899575" />
213
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
209
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
214
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
210
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
215
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
211
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
239
       </list>
235
       </list>
240
     </option>
236
     </option>
241
   </component>
237
   </component>
242
-  <component name="RunManager" selected="JUnit.ArrazTest.testRemoveElementFromArray1">
238
+  <component name="RunManager" selected="JUnit.ArrazTest.testInsertArrayAt2">
243
     <configuration default="true" type="Applet" factoryName="Applet">
239
     <configuration default="true" type="Applet" factoryName="Applet">
244
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
240
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
245
       <method v="2">
241
       <method v="2">
261
         <option name="Make" enabled="true" />
257
         <option name="Make" enabled="true" />
262
       </method>
258
       </method>
263
     </configuration>
259
     </configuration>
264
-    <configuration name="ArrazTest.testCopyArrayByIterator1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
260
+    <configuration name="ArrazTest.testInsertArrayAt1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
265
       <module name="arraz" />
261
       <module name="arraz" />
266
       <option name="PACKAGE_NAME" value="" />
262
       <option name="PACKAGE_NAME" value="" />
267
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
263
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
268
-      <option name="METHOD_NAME" value="testCopyArrayByIterator1" />
264
+      <option name="METHOD_NAME" value="testInsertArrayAt1" />
269
       <option name="TEST_OBJECT" value="method" />
265
       <option name="TEST_OBJECT" value="method" />
270
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
266
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
271
       <method v="2">
267
       <method v="2">
272
         <option name="Make" enabled="true" />
268
         <option name="Make" enabled="true" />
273
       </method>
269
       </method>
274
     </configuration>
270
     </configuration>
275
-    <configuration name="ArrazTest.testCopyArrayByIterator2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
271
+    <configuration name="ArrazTest.testInsertArrayAt2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
276
       <module name="arraz" />
272
       <module name="arraz" />
277
       <option name="PACKAGE_NAME" value="" />
273
       <option name="PACKAGE_NAME" value="" />
278
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
274
       <option name="MAIN_CLASS_NAME" value="ArrazTest" />
279
-      <option name="METHOD_NAME" value="testCopyArrayByIterator2" />
275
+      <option name="METHOD_NAME" value="testInsertArrayAt2" />
280
       <option name="TEST_OBJECT" value="method" />
276
       <option name="TEST_OBJECT" value="method" />
281
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
277
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
282
       <method v="2">
278
       <method v="2">
331
     <list>
327
     <list>
332
       <item itemvalue="JUnit.ArrazTest" />
328
       <item itemvalue="JUnit.ArrazTest" />
333
       <item itemvalue="JUnit.ArrazTest.testReverseArray1" />
329
       <item itemvalue="JUnit.ArrazTest.testReverseArray1" />
334
-      <item itemvalue="JUnit.ArrazTest.testCopyArrayByIterator1" />
335
-      <item itemvalue="JUnit.ArrazTest.testCopyArrayByIterator2" />
336
       <item itemvalue="JUnit.ArrazTest.testRemoveElementFromArray1" />
330
       <item itemvalue="JUnit.ArrazTest.testRemoveElementFromArray1" />
331
+      <item itemvalue="JUnit.ArrazTest.testInsertArrayAt1" />
332
+      <item itemvalue="JUnit.ArrazTest.testInsertArrayAt2" />
337
     </list>
333
     </list>
338
     <recent_temporary>
334
     <recent_temporary>
339
       <list>
335
       <list>
336
+        <item itemvalue="JUnit.ArrazTest.testInsertArrayAt2" />
337
+        <item itemvalue="JUnit.ArrazTest.testInsertArrayAt1" />
340
         <item itemvalue="JUnit.ArrazTest.testRemoveElementFromArray1" />
338
         <item itemvalue="JUnit.ArrazTest.testRemoveElementFromArray1" />
341
         <item itemvalue="JUnit.ArrazTest" />
339
         <item itemvalue="JUnit.ArrazTest" />
342
         <item itemvalue="JUnit.ArrazTest.testReverseArray1" />
340
         <item itemvalue="JUnit.ArrazTest.testReverseArray1" />
343
-        <item itemvalue="JUnit.ArrazTest.testCopyArrayByIterator2" />
344
-        <item itemvalue="JUnit.ArrazTest.testCopyArrayByIterator1" />
345
       </list>
341
       </list>
346
     </recent_temporary>
342
     </recent_temporary>
347
   </component>
343
   </component>
358
       <workItem from="1543955862749" duration="2347000" />
354
       <workItem from="1543955862749" duration="2347000" />
359
       <workItem from="1543958998826" duration="113000" />
355
       <workItem from="1543958998826" duration="113000" />
360
       <workItem from="1544020724645" duration="762000" />
356
       <workItem from="1544020724645" duration="762000" />
361
-      <workItem from="1544046933389" duration="12355000" />
357
+      <workItem from="1544046933389" duration="14993000" />
362
     </task>
358
     </task>
363
     <task id="LOCAL-00001" summary="readme and docs">
359
     <task id="LOCAL-00001" summary="readme and docs">
364
       <created>1544021313039</created>
360
       <created>1544021313039</created>
371
     <servers />
367
     <servers />
372
   </component>
368
   </component>
373
   <component name="TestHistory">
369
   <component name="TestHistory">
374
-    <history-entry file="ArrazTest - 2018.12.05 at 20h 14m 10s.xml">
375
-      <configuration name="ArrazTest" configurationId="JUnit" />
370
+    <history-entry file="ArrazTest_testInsertArrayAt1 - 2018.12.06 at 15h 31m 04s.xml">
371
+      <configuration name="ArrazTest.testInsertArrayAt1" configurationId="JUnit" />
376
     </history-entry>
372
     </history-entry>
377
-    <history-entry file="ArrazTest - 2018.12.05 at 20h 14m 26s.xml">
378
-      <configuration name="ArrazTest" configurationId="JUnit" />
373
+    <history-entry file="ArrazTest_testInsertArrayAt2 - 2018.12.06 at 15h 31m 08s.xml">
374
+      <configuration name="ArrazTest.testInsertArrayAt2" configurationId="JUnit" />
379
     </history-entry>
375
     </history-entry>
380
-    <history-entry file="ArrazTest - 2018.12.05 at 20h 21m 34s.xml">
381
-      <configuration name="ArrazTest" configurationId="JUnit" />
376
+    <history-entry file="ArrazTest_testInsertArrayAt2 - 2018.12.06 at 16h 03m 55s.xml">
377
+      <configuration name="ArrazTest.testInsertArrayAt2" configurationId="JUnit" />
382
     </history-entry>
378
     </history-entry>
383
-    <history-entry file="ArrazTest_testReverseArray1 - 2018.12.05 at 20h 36m 49s.xml">
384
-      <configuration name="ArrazTest.testReverseArray1" configurationId="JUnit" />
379
+    <history-entry file="ArrazTest_testInsertArrayAt1 - 2018.12.06 at 16h 08m 09s.xml">
380
+      <configuration name="ArrazTest.testInsertArrayAt1" configurationId="JUnit" />
385
     </history-entry>
381
     </history-entry>
386
-    <history-entry file="ArrazTest - 2018.12.06 at 08h 17m 38s.xml">
387
-      <configuration name="ArrazTest" configurationId="JUnit" />
382
+    <history-entry file="ArrazTest_testInsertArrayAt2 - 2018.12.06 at 16h 08m 11s.xml">
383
+      <configuration name="ArrazTest.testInsertArrayAt2" configurationId="JUnit" />
388
     </history-entry>
384
     </history-entry>
389
-    <history-entry file="ArrazTest_testCopyArrayByIterator1 - 2018.12.06 at 08h 34m 19s.xml">
390
-      <configuration name="ArrazTest.testCopyArrayByIterator1" configurationId="JUnit" />
385
+    <history-entry file="ArrazTest_testInsertArrayAt1 - 2018.12.06 at 16h 08m 38s.xml">
386
+      <configuration name="ArrazTest.testInsertArrayAt1" configurationId="JUnit" />
391
     </history-entry>
387
     </history-entry>
392
-    <history-entry file="ArrazTest_testCopyArrayByIterator2 - 2018.12.06 at 08h 34m 23s.xml">
393
-      <configuration name="ArrazTest.testCopyArrayByIterator2" configurationId="JUnit" />
388
+    <history-entry file="ArrazTest_testInsertArrayAt2 - 2018.12.06 at 16h 08m 41s.xml">
389
+      <configuration name="ArrazTest.testInsertArrayAt2" configurationId="JUnit" />
394
     </history-entry>
390
     </history-entry>
395
-    <history-entry file="ArrazTest - 2018.12.06 at 13h 17m 56s.xml">
396
-      <configuration name="ArrazTest" configurationId="JUnit" />
391
+    <history-entry file="ArrazTest_testInsertArrayAt1 - 2018.12.06 at 16h 11m 02s.xml">
392
+      <configuration name="ArrazTest.testInsertArrayAt1" configurationId="JUnit" />
397
     </history-entry>
393
     </history-entry>
398
-    <history-entry file="ArrazTest_testReverseArray1 - 2018.12.06 at 14h 52m 25s.xml">
399
-      <configuration name="ArrazTest.testReverseArray1" configurationId="JUnit" />
394
+    <history-entry file="ArrazTest_testInsertArrayAt1 - 2018.12.06 at 16h 11m 14s.xml">
395
+      <configuration name="ArrazTest.testInsertArrayAt1" configurationId="JUnit" />
400
     </history-entry>
396
     </history-entry>
401
-    <history-entry file="ArrazTest - 2018.12.06 at 14h 53m 48s.xml">
402
-      <configuration name="ArrazTest" configurationId="JUnit" />
397
+    <history-entry file="ArrazTest_testInsertArrayAt2 - 2018.12.06 at 16h 11m 17s.xml">
398
+      <configuration name="ArrazTest.testInsertArrayAt2" configurationId="JUnit" />
403
     </history-entry>
399
     </history-entry>
404
   </component>
400
   </component>
405
   <component name="TimeTrackingManager">
401
   <component name="TimeTrackingManager">
406
-    <option name="totallyTimeSpent" value="15577000" />
402
+    <option name="totallyTimeSpent" value="18215000" />
407
   </component>
403
   </component>
408
   <component name="ToolWindowManager">
404
   <component name="ToolWindowManager">
409
     <frame x="0" y="23" width="1440" height="807" extended-state="6" />
405
     <frame x="0" y="23" width="1440" height="807" extended-state="6" />
406
+    <editor active="true" />
410
     <layout>
407
     <layout>
411
       <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26108727" />
408
       <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26108727" />
412
       <window_info id="Structure" order="1" weight="0.25" />
409
       <window_info id="Structure" order="1" weight="0.25" />
448
     <MESSAGE value="readme and docs" />
445
     <MESSAGE value="readme and docs" />
449
     <option name="LAST_COMMIT_MESSAGE" value="readme and docs" />
446
     <option name="LAST_COMMIT_MESSAGE" value="readme and docs" />
450
   </component>
447
   </component>
448
+  <component name="XDebuggerManager">
449
+    <breakpoint-manager>
450
+      <breakpoints>
451
+        <line-breakpoint enabled="true" type="java-method">
452
+          <url>file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java</url>
453
+          <line>103</line>
454
+          <properties class="Arraz" method="insertArrayAt">
455
+            <option name="EMULATED" value="true" />
456
+          </properties>
457
+          <option name="timeStamp" value="4" />
458
+        </line-breakpoint>
459
+      </breakpoints>
460
+    </breakpoint-manager>
461
+  </component>
451
   <component name="editorHistoryManager">
462
   <component name="editorHistoryManager">
452
-    <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
453
-      <provider selected="true" editor-type-id="text-editor">
454
-        <state relative-caret-position="240">
455
-          <caret line="16" selection-start-line="16" selection-end-line="16" />
456
-        </state>
457
-      </provider>
458
-    </entry>
459
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
463
     <entry file="file://$PROJECT_DIR$/arraz/src/main/java/OddEven.java">
460
       <provider selected="true" editor-type-id="text-editor">
464
       <provider selected="true" editor-type-id="text-editor">
461
         <state>
465
         <state>
469
         </state>
473
         </state>
470
       </provider>
474
       </provider>
471
     </entry>
475
     </entry>
472
-    <entry file="file://$PROJECT_DIR$/README.md">
473
-      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
474
-        <state split_layout="SPLIT">
475
-          <first_editor relative-caret-position="381">
476
-            <caret line="74" column="117" selection-start-line="74" selection-start-column="113" selection-end-line="74" selection-end-column="117" />
477
-          </first_editor>
478
-          <second_editor />
476
+    <entry file="file://$PROJECT_DIR$/arraz/pom.xml">
477
+      <provider selected="true" editor-type-id="text-editor">
478
+        <state relative-caret-position="240">
479
+          <caret line="16" selection-start-line="16" selection-end-line="16" />
479
         </state>
480
         </state>
480
       </provider>
481
       </provider>
481
     </entry>
482
     </entry>
482
-    <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
483
+    <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
483
       <provider selected="true" editor-type-id="text-editor">
484
       <provider selected="true" editor-type-id="text-editor">
484
-        <state relative-caret-position="-902">
485
-          <caret line="109" column="50" selection-start-line="109" selection-start-column="50" selection-end-line="109" selection-end-column="50" />
485
+        <state relative-caret-position="343">
486
+          <caret line="113" column="13" selection-start-line="113" selection-start-column="13" selection-end-line="113" selection-end-column="13" />
486
           <folding>
487
           <folding>
487
             <element signature="imports" expanded="true" />
488
             <element signature="imports" expanded="true" />
488
-            <element signature="e#4388#4389#0" expanded="true" />
489
-            <element signature="e#4411#4412#0" expanded="true" />
490
           </folding>
489
           </folding>
491
         </state>
490
         </state>
492
       </provider>
491
       </provider>
493
     </entry>
492
     </entry>
494
-    <entry file="file://$PROJECT_DIR$/arraz/src/main/java/Arraz.java">
493
+    <entry file="file://$PROJECT_DIR$/arraz/src/test/java/ArrazTest.java">
495
       <provider selected="true" editor-type-id="text-editor">
494
       <provider selected="true" editor-type-id="text-editor">
496
-        <state relative-caret-position="343">
497
-          <caret line="103" lean-forward="true" selection-start-line="103" selection-end-line="103" />
495
+        <state relative-caret-position="358">
496
+          <caret line="209" selection-start-line="209" selection-end-line="209" />
498
           <folding>
497
           <folding>
499
             <element signature="imports" expanded="true" />
498
             <element signature="imports" expanded="true" />
499
+            <element signature="e#4388#4389#0" expanded="true" />
500
+            <element signature="e#4411#4412#0" expanded="true" />
500
           </folding>
501
           </folding>
501
         </state>
502
         </state>
502
       </provider>
503
       </provider>
503
     </entry>
504
     </entry>
505
+    <entry file="file://$PROJECT_DIR$/README.md">
506
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
507
+        <state split_layout="SPLIT">
508
+          <first_editor relative-caret-position="306">
509
+            <caret line="69" column="5" lean-forward="true" selection-start-line="69" selection-start-column="5" selection-end-line="69" selection-end-column="5" />
510
+          </first_editor>
511
+          <second_editor />
512
+        </state>
513
+      </provider>
514
+    </entry>
504
   </component>
515
   </component>
505
   <component name="masterDetails">
516
   <component name="masterDetails">
506
     <states>
517
     <states>

+ 15
- 0
arraz/src/main/java/Arraz.java Ver arquivo

100
         }
100
         }
101
         return newArray;
101
         return newArray;
102
     }
102
     }
103
+
104
+    public int[] insertArrayAt(int[] array, int index, int value){
105
+        int[] newArray = new int[array.length + 1];
106
+        int counter = 0;
107
+        for (int i = 0; i < array.length-1; i++) {
108
+            if (i == index){
109
+                newArray[index] = value;
110
+                counter++;
111
+            }else {
112
+                newArray[counter] = array[i];
113
+                counter++;
114
+            }
115
+        }
116
+        return newArray;
117
+        }
103
 }
118
 }

+ 18
- 0
arraz/src/test/java/ArrazTest.java Ver arquivo

190
 
190
 
191
         Assert.assertArrayEquals(expected, actual);
191
         Assert.assertArrayEquals(expected, actual);
192
     }
192
     }
193
+
194
+    @Test
195
+    public void testInsertArrayAt1(){
196
+        int[] expected = new int[]{5, 10, 17, 3, 29, 100};
197
+        int[] actual = testArraz.insertArrayAt(arr1, 2, 17);
198
+
199
+        Assert.assertArrayEquals(expected, actual);
200
+    }
201
+
202
+    @Test
203
+    public void testInsertArrayAt2(){
204
+        int[] expected =  new int[]{2, 7, 432, 89, 6};
205
+        int[] actual = testArraz.insertArrayAt(arr2, 4, 6);
206
+
207
+        Assert.assertArrayEquals(expected, actual);
208
+    }
209
+
210
+
193
 }
211
 }