@Override
    public int compare(Task o1, Task o2) {
        int result = 0 ;
        switch(TypeOfComparison) {
            
            case By_title:
                result = o1.getTitle().compareToIgnoreCase(o2.getTitle());
            case By_modelID:
               result = o1.getModelId().compareTo(o2.getModelId());
                break;
            case By_Priority:
               result = o1.getPriority().compareTo(o2.getPriority());
                break;  
            case By_Date:
                result = o1.getStartDate().compareTo(o2.getStartDate());
                break;
        }
        
        return result;
    }