ZooKeeperClient { public synchronized void close() { if (zooKeeper != null) { try { zooKeeper.close(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOG.warn("Interrupted trying to close zooKeeper"); } finally { zooKeeper = null; sessionState = null; } } } ZooKeeperClient(Amount<Integer, Time> sessionTimeout, InetSocketAddress zooKeeperServer,
      InetSocketAddress... zooKeeperServers);  ZooKeeperClient(Amount<Integer, Time> sessionTimeout,
      Iterable<InetSocketAddress> zooKeeperServers);  ZooKeeperClient(Amount<Integer, Time> sessionTimeout, Credentials credentials,
      InetSocketAddress zooKeeperServer, InetSocketAddress... zooKeeperServers);  ZooKeeperClient(Amount<Integer, Time> sessionTimeout, Credentials credentials,
      Iterable<InetSocketAddress> zooKeeperServers);  ZooKeeperClient(Amount<Integer, Time> sessionTimeout, Optional<Credentials> credentials,
      Optional<String> chrootPath, Iterable<InetSocketAddress> zooKeeperServers); synchronized ZooKeeper get(); synchronized ZooKeeper get(Amount<Long, Time> connectionTimeout); Watcher registerExpirationHandler(final Command onExpired); void register(Watcher watcher); boolean unregister(Watcher watcher); boolean shouldRetry(KeeperException e); synchronized void close();  }
@Test public void testClose() throws Exception { ZooKeeperClient zkClient = createZkClient(); zkClient.close(); zkClient.close(); long firstSessionId = zkClient.get().getSessionId(); zkClient.close(); assertNotEquals(firstSessionId, zkClient.get().getSessionId()); }