code: static DoublesUnionImplR wrapInstance(final Memory mem) {
      final DirectUpdateDoublesSketchR sketch = DirectUpdateDoublesSketchR.wrapInstance(mem);
      final int k = sketch.getK();
      final DoublesUnionImplR union = new DoublesUnionImplR(k);
      union.maxK_ = k;
      union.gadget_ = sketch;
      return union;
    }
docs: Returns a read-only 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