Implement Task.compareTo() that supports all three types of tasks