The Comparator would not sort anything. It would be passed as a resource to a method which does sort things. Something like this
Obviously the array has to be a type compatible with the Comparator, i.e. Integer[].
As Paweł says, there are possible errors in that method. You can read about “ordering”
in the Java Tutorials. It tells you about that error.
That Comparator is actually redundant, because Integer already implements the Comparable<Integer> interface, so you can say