code: public Versioned<V> update(V newValue, long newVersion) {
      Versioned<V> previousValue = value;
      value = new Versioned<>(newValue, newVersion);
      return previousValue;
    }
docs: Updates the node value.
  
  @param newValue   new value to set
  @param newVersion new version to set
  @return previous value