code: public ItemsSketch<T> merge(final ItemsSketch<T> other) {
      if (other == null) { return this; }
      if (other.isEmpty()) { return this; }
  
      final long streamLen = this.streamWeight + other.streamWeight; //capture before merge
  
      final ReversePurgeItemHashMap.Iterator<T> iter = other.hashMap.iterator();
      while (iter.next()) { //this may add to offset during rebuilds
        this.update(iter.getKey(), iter.getValue());
      }
      this.offset += other.offset;
      this.streamWeight = streamLen; //corrected streamWeight
      return this;
    }
docs: This function merges the other sketch into this one.
  The other sketch may be of a different size.
  
  @param other sketch of this class
  @return a sketch whose estimates are within the guarantees of the
  largest error tolerance of the two merged sketches.