@@ -0,0 +1,669 @@
+package water;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport water.util.ArrayUtils;%0Aimport java.util.Arrays;%0A%0Apublic class SortTest extends TestUtil %7B%0A  @BeforeClass() public static void setup() %7B stall_till_cloudsize(1); %7D%0A%0A  @Test public void run() %7B%0A    int%5B%5D idxs = new int%5B%5D%7B0,1,2,3,4%7D;%0A    final double%5B%5D avgs = new double%5B%5D%7B4.2,1.0,-1,4.3,2.0%7D;%0A    ArrayUtils.sort(idxs, new ArrayUtils.IntComparator() %7B%0A      @Override%0A      public int compare(int x, int y) %7B%0A        return avgs%5Bx%5D %3C avgs%5By%5D ? -1 : (avgs%5Bx%5D %3E avgs%5By%5D ? 1 : 0);%0A      %7D%0A    %7D);%0A    Assert.assertTrue(Arrays.equals(idxs, new int%5B%5D%7B2, 1, 4, 0, 3%7D));%0A  %7D%0A%7D%0A

Add JUnit for sorting.