3 import static org.testng.AssertJUnit.assertEquals;
5 import java.util.Arrays;
7 import org.testng.annotations.Test;
9 public class ArrayUtilsTest
11 @Test(groups="Functional")
12 public void testReverseIntArray() {
14 // null value: should be no exception
15 ArrayUtils.reverseIntArray((int[]) null);
17 // empty array: should be no exception
18 int[] arr = new int[] {};
19 ArrayUtils.reverseIntArray(arr);
22 arr = new int[] { 1, 2, 3, 4 };
23 ArrayUtils.reverseIntArray(arr);
24 assertEquals("[4, 3, 2, 1]", Arrays.toString(arr));
27 arr = new int[] { 1, 2, 3, 4, 5 };
28 ArrayUtils.reverseIntArray(arr);
29 assertEquals("[5, 4, 3, 2, 1]", Arrays.toString(arr));