code: static DoublesUnionImpl wrapInstance(final WritableMemory mem) {
      final DirectUpdateDoublesSketch sketch = DirectUpdateDoublesSketch.wrapInstance(mem);
      final DoublesUnionImpl union = new DoublesUnionImpl(sketch.getK());
      union.gadget_ = sketch;
      return union;
    }
docs: Returns an updatable Union object that wraps off-heap data structure of the given memory
  image of a non-compact DoublesSketch. The data structures of the Union remain off-heap.
  
  @param mem A memory image of a non-compact DoublesSketch to be used as the data
  structure for the union and will be modified.
  @return a Union object