### Question:
Sort { int[] sort(int[] arr) { boolean changed = false; do { changed = false; for (int a = 0; a < arr.length - 1; a++) { if (arr[a] > arr[a + 1]) { int tmp = arr[a]; arr[a] = arr[a + 1]; arr[a + 1] = tmp; changed = true; } } } while (changed); 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)); }