code: @Override
    public void shutdown(final String taskid, String reason)
    {
      log.info("Shutdown [%s] because: [%s]", taskid, reason);
      if (runningItem != null && runningItem.getTask().getId().equals(taskid)) {
        runningItem.getResult().cancel(true);
      }
    }
docs: There might be a race between {@link #run(Task)} and this method, but it shouldn't happen in real applications
  because this method is called only in unit tests. See TaskLifecycleTest.
  
  @param taskid task ID to clean up resources for