code: public void setWebDriver(WebDriver aWebDriver, int defaultTimeout) {
          if (webDriver != null && !webDriver.equals(aWebDriver)) {
              webDriver.quit();
          }
          webDriver = aWebDriver;
  
          if (webDriver == null) {
              webDriverWait = null;
          } else {
              webDriverWait = new WebDriverWait(webDriver, defaultTimeout);
          }
      }
docs: Sets up webDriver to be used.
  @param aWebDriver web driver to use.
  @param defaultTimeout default timeout to wait, in seconds.