@VisibleForTesting
  SamzaContainer getContainer() {
    return container;
  }
<p>
Asynchronously stops the {@link StreamProcessor}'s running components - {@link SamzaContainer}
and {@link JobCoordinator}
</p>
Here're the ways which can stop the StreamProcessor:
<ol>
  <li>Caller of StreamProcessor invokes stop()</li>
  <li>Samza Container completes processing (eg. bounded input) and shuts down</li>
  <li>Samza Container fails</li>
  <li>Job Coordinator fails</li>
</ol>
When either container or coordinator stops (cleanly or due to exception), it will try to shutdown the
StreamProcessor. This needs to be synchronized so that only one code path gets triggered for shutdown.
<br>
If container is running,
<ol>
  <li>container is shutdown cleanly and {@link SamzaContainerListener#afterStop()} will trigger
  {@link JobCoordinator#stop()}</li>
  <li>container fails to shutdown cleanly and {@link SamzaContainerListener#afterFailure(Throwable)} will
  trigger {@link JobCoordinator#stop()}</li>
</ol>
If container is not running, then this method will simply shutdown the {@link JobCoordinator}.
samza-core/src/main/java/org/apache/samza/processor/StreamProcessor.java