(String[] args)
| 16 | |
| 17 | public class ComparatorTest { |
| 18 | public static void main(String[] args) { |
| 19 | CompType[] a = new CompType[12]; |
| 20 | Arrays.setAll(a, n -> CompType.get()); |
| 21 | show("Before sorting", a); |
| 22 | Arrays.sort(a, new CompTypeComparator()); |
| 23 | show("After sorting", a); |
| 24 | } |
| 25 | } |
| 26 | /* Output: |
| 27 | Before sorting: [[i = 35, j = 37], [i = 41, j = 20], [i |