/**
  * This method locates the desired Task by calling chooseStrategy in order to use the correct
  * strategy to retrieve the Task and it status.
  *
  * @param task
  * @return Task
  */
 public Task checkStatus(Task task) {
   SessionBasedFindingStrategy strategy = new RembrandtAsynchronousFindingStrategy();
   TaskResult taskResult = strategy.retrieveTaskResult(task);
   if (taskResult != null) {
     task = taskResult.getTask();
   }
   return task;
 }
 /**
  * This method locates the desired TaskResult by calling chooseStrategy in order to use the
  * correct strategy to retrieve the result.
  *
  * @param task
  * @return TaskResult
  */
 public TaskResult getTaskResult(Task task) {
   SessionBasedFindingStrategy strategy = new RembrandtAsynchronousFindingStrategy();
   TaskResult taskResult = strategy.retrieveTaskResult(task);
   return taskResult;
 }