code: VarOptItemsSketch<T> copyAndSetN(final boolean asSketch, final long adjustedN) {
      final VarOptItemsSketch<T> sketch;
      sketch = new VarOptItemsSketch<>(data_, weights_, k_,n_,
              currItemsAlloc_, rf_, h_, r_, totalWtR_);
  
      if (!asSketch) {
        sketch.marks_ = this.marks_;
        sketch.numMarksInH_ = this.numMarksInH_;
      }
  
      if (adjustedN >= 0) {
        sketch.n_ = adjustedN;
      }
  
      return sketch;
    }
docs: Creates a copy of the sketch, optionally discarding any information about marks that would
  indicate the class's use as a union gadget as opposed to a valid sketch.
  
  @param asSketch If true, copies as a sketch; if false, copies as a union gadget
  @param adjustedN Target value of n for the resulting sketch. Ignored if negative.
  @return A copy of the sketch.