docs: @SuppressWarnings("unchecked")
  	private RetrievableStateHandle<T> get(String pathInZooKeeper, boolean lock) throws Exception {
  		checkNotNull(pathInZooKeeper, "Path in ZooKeeper");
  
  		final String path = normalizePath(pathInZooKeeper);
  
  		if (lock) {
  			// try to lock the node
  			try {
  				client.create().withMode(CreateMode.EPHEMERAL).forPath(getLockPath(path));
  			} catch (KeeperException.NodeExistsException ignored) {
  				// we have already created the lock
  			}
  		}
  
  		boolean success = false;
  
  		try {
  			byte[] data = client.getData().forPath(path);
  
  			try {
  				RetrievableStateHandle<T> retrievableStateHandle = InstantiationUtil.deserializeObject(
  					data,
  					Thread.currentThread().getContextClassLoader());
  
  				success = true;
  
  				return retrievableStateHandle;
  			} catch (IOException | ClassNotFoundException e) {
  				throw new IOException("Failed to deserialize state handle from ZooKeeper data from " +
  					path + '.', e);
  			}
  		} finally {
  			if (!success && lock) {
  				// release the lock
  				release(path);
  			}
  		}
  	}