code: public void shutdown() throws Exception {
          if (type == null) {
              return;
          }
          if (type instanceof Hub) {
              ((Hub) type).stop();
          }
          if (type instanceof SelfRegisteringRemote) {
              ((SelfRegisteringRemote) type).stopRemoteServer();
          }
          if (type instanceof SeleniumServer) {
              ((SeleniumServer) type).stop();
          }
          LOGGER.info("Selenium is shut down");
      }
docs: Shutdown the instance
  
  @throws Exception