code: void closeTask(final byte[] message) {
      synchronized (this.contextLifeCycle) {
        if (!this.task.isPresent()) {
          LOG.log(Level.WARNING, "Received a close task while there was no task running. Ignoring.");
        } else {
          this.task.get().close(message);
        }
      }
    }
docs: Issue a close call to the Task
  <p>
  Note that due to races, the task might have already ended. In that case, we drop this call and leave a WARNING
  in the log.
  
  @param message the close  message to deliver or null if there is none.