ArrayUtils { public static void swap(int[] data, int elementIndex1, int elementIndex2) { int tmp = data[elementIndex1]; data[elementIndex1] = data[elementIndex2]; data[elementIndex2] = tmp; }  static void swap(int[] data, int elementIndex1, int elementIndex2); static int selectNthSmallestElement(int[] data, int n); static int selectNthSmallestElement(int[] data, int sublistStartIndex, int sublistEndIndex, int n);  }
@Test public void testSwap() { int[] testArr = {1, 2, 4, 3}; ArrayUtils.swap(testArr, 2, 3); Assert.assertEquals(testArr[0], 1); Assert.assertEquals(testArr[1], 2); Assert.assertEquals(testArr[2], 3); Assert.assertEquals(testArr[3], 4); }