Sort ascending by significance

The following example features an anonymous class instance for an comperator
 
    public static void main(String[] args) {
        ArrayList<Integer> tosort=new ArrayList<Integer>();
        tosort.add(5);
        tosort.add(1);
        tosort.add(7);
        Collections.sort(tosort,new Comparator<Integer>() {
            @Override
            public int compare(Integer i1, Integer i2) {
                if(i1 < i2)return -1;
                if(i1 > i2 )return 1;
                return 0;
            }
        });
        for(int i:tosort) System.out.println(i);
        // 1
        // 5
        // 7
    }