Валидатор подчеркивает Collection.sort(list); for (int i : list) { System.out.println(i); sort - красным!