code: static <T> VarOptItemsSketch<T> newInstanceFromUnionResult(final ArrayList<T> dataList,
                                                               final ArrayList<Double> weightList,
                                                               final int k,
                                                               final long n,
                                                               final int hCount,
                                                               final int rCount,
                                                               final double totalWtR) {
      final VarOptItemsSketch<T> sketch =  new VarOptItemsSketch<>(dataList, weightList, k, n,
              dataList.size(), DEFAULT_RESIZE_FACTOR, hCount, rCount, totalWtR);
      sketch.convertToHeap();
      return sketch;
    }
docs: Construct a varopt sketch as the output of a union's getResult() method. Because this method
  is package-private, we do not perform checks on the input values.
  
  <p>Assumes dataList.size() is the correct allocated size but does not check.</p>
  
  @param <T> The type of object held in the sketch.
  @param dataList an ArrayList of data
  @param weightList an ArrayList of weights
  @param k   Maximum size of sampling. Allocated size may be smaller until sketch fills.
  Unlike many sketches in this package, this value does <em>not</em> need to be a
  power of 2.
  @param n The current count of items seen by the sketch
  @param hCount the count of heavy items
  @param rCount the reservoir count of (non-heavy) items
  @param totalWtR the sum of the reservoir weights.
  @return A VarOptItemsSketch initialized with maximum size k and a valid array of marks.