MoveZerosInArray { public void moveSorting(int[] array) { validateArray(array); boolean swap = true; while (swap) { swap = false; for (int i = 0; i < array.length - 1; i++) { if ((array[i] < array[i + 1] && array[i + 1] > 0)) { swap(array, i, i + 1); swap = true; } } } }  void moveSorting(int[] array); void moveUsingTwoPointers(int[] array);  }
@Test(expected = IllegalArgumentException.class) public void shouldNotAcceptNullArraysSorting() { moveZeros.moveSorting(null); }
@Test public void shouldWorkWithAnEmptyArraySorting() { int[] array = new int[0]; moveZeros.moveSorting(array); assertArrayEquals(new int[0], array); }