@@ -0,0 +1,954 @@
+package collection.sort;%0A%0Aimport data.User;%0A%0Aimport java.util.*;%0A%0Apublic class Main %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        System.out.println(%22Hello World!%22);%0A%0A        List%3CUser%3E  list = new ArrayList%3C%3E();%0A        list.add(new User(%22BBB%22,18));%0A        list.add(new User(%22CCC%22,19));%0A        list.add(new User(%22AAA%22,17));%0A        list.add(new User(%22DDDD%22,13));%0A%0A%0A        System.out.println(%22Hello World!%22+ Arrays.toString(list.toArray()));%0A%0A        Collections.sort(list, new Comparator%3CUser%3E() %7B%0A            @Override%0A            public int compare(User user1, User user2) %7B%0A                if (user1.getAge() %3E user2.getAge()) %7B%0A                    return -1;%0A                %7D else if (user1.getAge()%3Cuser2.getAge()) %7B%0A                    return 1;%0A                %7D else %7B%0A                    return 0;%0A                %7D%0A            %7D%0A        %7D);%0A%0A        System.out.println(%22Hello World!%22+ Arrays.toString(list.toArray()));%0A%0A    %7D%0A%7D%0A

add sort