code: static DoublesUnionImpl directInstance(final int maxK, final WritableMemory dstMem) {
      final DirectUpdateDoublesSketch sketch = DirectUpdateDoublesSketch.newInstance(maxK, dstMem);
      final DoublesUnionImpl union = new DoublesUnionImpl(maxK);
      union.maxK_ = maxK;
      union.gadget_ = sketch;
      return union;
    }
docs: Returns a empty DoublesUnion object that refers to the given direct, off-heap Memory,
  which will be initialized to the empty state.
  
  @param maxK determines the accuracy and size of the union and is a maximum value.
  The effective <i>k</i> can be smaller due to unions with smaller <i>k</i> sketches.
  It is recommended that <i>maxK</i> be a power of 2 to enable unioning of sketches with
  different values of <i>k</i>.
  @param dstMem the Memory to be used by the sketch
  @return a DoublesUnion object