code: static DoublesUnionImpl heapifyInstance(final DoublesSketch sketch) {
      final int k = sketch.getK();
      final DoublesUnionImpl union = new DoublesUnionImpl(k);
      union.maxK_ = k;
      union.gadget_ = copyToHeap(sketch);
      return union;
    }
docs: Returns a Heap DoublesUnion object that has been initialized with the data from the given
  sketch.
  
  @param sketch A DoublesSketch to be used as a source of data only and will not be modified.
  @return a DoublesUnion object