diff --git a/core-java-modules/core-java-arrays-operations-advanced-2/src/test/java/com/baeldung/movezerototheend/MoveZeroesToTheEndOfAnArrayUnitTest.java b/core-java-modules/core-java-arrays-operations-advanced-2/src/test/java/com/baeldung/movezerototheend/MoveZeroesToTheEndOfAnArrayUnitTest.java index ae0152feca..1d56e1f50b 100644 --- a/core-java-modules/core-java-arrays-operations-advanced-2/src/test/java/com/baeldung/movezerototheend/MoveZeroesToTheEndOfAnArrayUnitTest.java +++ b/core-java-modules/core-java-arrays-operations-advanced-2/src/test/java/com/baeldung/movezerototheend/MoveZeroesToTheEndOfAnArrayUnitTest.java @@ -7,11 +7,11 @@ import java.util.Arrays; import static org.junit.jupiter.api.Assertions.assertArrayEquals; public class MoveZeroesToTheEndOfAnArrayUnitTest { - static final int[] EXPECTED = new int[] { 1, 2, 3, 4, 0, 0 }; + private static final int[] EXPECTED = new int[] { 42, 2, 3, 4, 0, 0 }; @Test void whenCreatingANewArrayAndCopyingValues_thenGetTheExpectedResult() { - int[] array = new int[] { 1, 2, 0, 3, 4, 0 }; + int[] array = new int[] { 42, 2, 0, 3, 4, 0 }; int[] result = new int[array.length]; int idx = 0; for (int n : array) { @@ -24,13 +24,12 @@ public class MoveZeroesToTheEndOfAnArrayUnitTest { @Test void whenMovingZeroInTheOriginalArray_thenGetTheExpectedResult() { - int[] array = new int[] { 1, 2, 0, 3, 4, 0 }; + int[] array = new int[] { 42, 2, 0, 3, 4, 0 }; int idx = 0; for (int n : array) { if (n != 0) { array[idx++] = n; } - System.out.println(Arrays.toString(array)); } while (idx < array.length) { array[idx++] = 0;