static void sort(List<Comparable> list) { for (int i = 0; i < list.size(); i++) { int minId = getMinimalIndex(list, i); swap(list, i, minId); } }