SelectionSort { public static int[] sort(int[] arr) { for (int i = 0; i < arr.length; i++) { int min = findMinIndex(arr, i); swap(arr, i, min); } return arr; }  static int[] sort(int[] arr);  }
@Test public void shouldSortNumbersInAscendingOrder() throws Exception { int[] sortedArr = SelectionSort.sort(new int[]{2, 5, 1, 3, 4}); assertThat(sortedArr, CoreMatchers.equalTo(new int[]{1, 2, 3, 4, 5})); }