### Question:
Sort { int[] sort(int[] arr) { for(int i = 1; i < arr.length; i++){ int value = arr[i]; int j = i - 1; while(j >= 0 && arr[j] > value){ arr[j + 1] = arr[j]; j = j - 1; } arr[j + 1] = value; } return arr; }    }### Answer:
@Test(timeout=1000) public void randomArrayTest() { for (int i = 0; i < 100; i++) { int[] random = getRandomArray(new Random().nextInt(200)+1); assertArrayEquals(sort(random), new Sort().sort(random)); } }
@Test(timeout=1000) public void sortArrayTest() { for (int i = 0; i < 50; i++) { int[] random = getSortArray(new Random().nextInt(200)+1); assertArrayEquals(random, new Sort().sort(random)); } }
@Test(timeout=1000) public void reverseArrayTest() { for (int i = 0; i < 50; i++) { int[] random = getReverseArray(new Random().nextInt(200)+1); assertArrayEquals(sort(random), new Sort().sort(random)); } }
@Test(timeout=1000) public void equalArrayTest() { for (int i = 0; i < 50; i++) { int[] random = getEqualArray(new Random().nextInt(200)+1); assertArrayEquals(sort(random), new Sort().sort(random)); } }
@Test(timeout=1000) public void emptyArrayTest() { int[] random = new int[0]; assertArrayEquals(sort(random), new Sort().sort(random)); }