docs: static final DirectCouponHashSet promoteListToSet(final DirectCouponList src) {
      final WritableMemory wmem = src.wmem;
  
      //get the data from the current memory
      HllUtil.checkPreamble(wmem); //sanity check
      final int lgConfigK = src.lgConfigK;
      final TgtHllType tgtHllType = src.tgtHllType;
      final int srcOffset = LIST_INT_ARR_START;
      final int couponArrInts = 1 << src.getLgCouponArrInts();
      final int[] couponArr = new int[couponArrInts]; //buffer
      wmem.getIntArray(srcOffset, couponArr, 0, couponArrInts);
  
      //rewrite the memory image as a SET:
      insertPreInts(wmem, HASH_SET_PREINTS);
      //SerVer, FamID, LgK  should be OK
      insertLgArr(wmem, LG_INIT_SET_SIZE);
      insertFlags(wmem, (byte) OUT_OF_ORDER_FLAG_MASK); //set oooFlag
      insertCurMin(wmem, 0); //was list count
      insertCurMode(wmem, CurMode.SET);
      //tgtHllType should already be set
      final int maxBytes = HllSketch.getMaxUpdatableSerializationBytes(lgConfigK, tgtHllType);
      wmem.clear(LIST_INT_ARR_START, maxBytes - LIST_INT_ARR_START); //clear all past first 8
  
      //create the tgt
      final DirectCouponHashSet dchSet
          = new DirectCouponHashSet(src.lgConfigK, src.tgtHllType, src.wmem);
  
      //now reload the coupon data into the set
      for (int i = 0; i < couponArrInts; i++) {
        final int coupon = couponArr[i];
        if (coupon != EMPTY) {
          dchSet.couponUpdate(coupon);
        }
      }
      return dchSet;
    }