code: public synchronized String getTaskStatus(final int taskId) throws NotFoundException {
  
      final TaskEntity running = getTask(taskId, runningTasks);
      if (running != null) {
        return "Running : " + running.toString();
      }
  
      final TaskEntity waiting = getTask(taskId, taskQueue);
      if (waiting != null) {
        return "Waiting : " + waiting.toString();
      }
  
      final TaskEntity finished = getTask(taskId, finishedTasks);
      if (finished != null) {
        return "Finished : " + finished.toString();
      }
  
      final TaskEntity canceled = getTask(taskId, canceledTasks);
      if (canceled != null) {
        return "Canceled: " + canceled.toString();
      }
  
      throw new NotFoundException(
          new StringBuilder().append("Task with ID ").append(taskId).append(" is not found").toString());
    }
docs: Get the status of a Task.
  @return the status of the Task.