small fix

This commit is contained in:
Ahmed Tawila 2017-10-25 15:53:15 +02:00
parent 376206389f
commit 9ce32992a7
2 changed files with 9 additions and 8 deletions

View File

@ -71,7 +71,7 @@ public class ArrayInitializer {
return array;
}
public static char[] initializeArrayUsingArraysUtilClone() {
static char[] initializeArrayUsingArraysUtilClone() {
char[] array = new char[] { 'a', 'b', 'c' };
return ArrayUtils.clone(array);
}

View File

@ -67,6 +67,7 @@ public class ArrayInitializerTest {
assertArrayEquals(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, initializeArrayUsingArraysSetAll());
}
@Test
public void whenInitializeArrayUsingArraysUtilClone_thenCorrect() {
assertArrayEquals(new char[] { 'a', 'b', 'c' }, initializeArrayUsingArraysUtilClone());
}