Implement a Comparator instead of Comparable interface for sorting intervals.