Student example of using comparator