@Nullable
 public TaskDescriptor<IndexCommandResult> getIndexTask(long taskId) {
   TaskDescriptor<IndexCommandResult> indexingTask = null;
   final TaskDescriptor<?> task = taskManager.getTask(taskId);
   if (task != null && task.getTaskContext() instanceof IndexTaskContext) {
     indexingTask = (TaskDescriptor<IndexCommandResult>) task;
   }
   return indexingTask;
 }
 public int compare(TaskDescriptor left, TaskDescriptor right) {
   return Longs.compare(left.getTaskId(), right.getTaskId());
 }