code: public long set(int idx, long value) {
      Preconditions.checkElementIndex(idx, this.values.size());
      return this.values.set(idx, value);
    }
docs: Set the idx'th value of this watermark. idx must be between 0 and size()-1.