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()
15 // null value: should be no exception
16 ArrayUtils.reverseIntArray((int[]) null);
18 // empty array: should be no exception
19 int[] arr = new int[] {};
20 ArrayUtils.reverseIntArray(arr);
23 arr = new int[] { 1, 2, 3, 4 };
24 ArrayUtils.reverseIntArray(arr);
25 assertEquals("[4, 3, 2, 1]", Arrays.toString(arr));
28 arr = new int[] { 1, 2, 3, 4, 5 };
29 ArrayUtils.reverseIntArray(arr);
30 assertEquals("[5, 4, 3, 2, 1]", Arrays.toString(arr));