code: public void stop() throws ExecutionException {
  
          logger.exiting();
  
          if (!bStartSession) {
              throw new IllegalStateException("Please call startSession() before calling endSession()");
          }
          bStartSession = false;
  
          try {
              result.get();
          } catch (InterruptedException e) {
              logger.log(Level.SEVERE, "InterruptedException occured while pinging the WebDriver", e);
          }
  
          logger.exiting();
      }
docs: {@link WebDriverSessionHandler#stop()} will stop the polling child thread.
  
  @throws ExecutionException
  thrown when exceptions occur in the child thread while polling.