code: public boolean trySetValue(VersionedValue<byte[]> previous, byte[] newValue) throws Exception
      {
          Preconditions.checkState(state.get() == State.STARTED, "not started");
  
          VersionedValue<byte[]> current = currentValue.get();
          if ( previous.getVersion() != current.getVersion() || !Arrays.equals(previous.getValue(), current.getValue()) )
          {
              return false;
          }
  
          try
          {
              Stat result = client.setData().withVersion(previous.getVersion()).forPath(path, newValue);
              updateValue(result.getVersion(), Arrays.copyOf(newValue, newValue.length));
              return true;
          }
          catch ( KeeperException.BadVersionException ignore )
          {
              // ignore
          }
  
          readValue();
          return false;
      }
docs: Changes the shared value only if its value has not changed since the version specified by
  newValue. If the value has changed, the value is not set and this client's view of the
  value is updated. i.e. if the value is not successful you can get the updated value
  by calling {@link #getValue()}.
  
  @param newValue the new value to attempt
  @return true if the change attempt was successful, false if not. If the change
  was not successful, {@link #getValue()} will return the updated value
  @throws Exception ZK errors, interruptions, etc.