code: private void twoWayMergeInternal(final ReservoirItemsSketch<T> sketchIn,
                                     final boolean isModifiable) {
      if (sketchIn.getN() <= sketchIn.getK()) {
        twoWayMergeInternalStandard(sketchIn);
      } else if (gadget_.getN() < gadget_.getK()) {
        // merge into sketchIn, so swap first
        final ReservoirItemsSketch<T> tmpSketch = gadget_;
        gadget_ = (isModifiable ? sketchIn : sketchIn.copy());
        twoWayMergeInternalStandard(tmpSketch);
      } else if (sketchIn.getImplicitSampleWeight() < (gadget_.getN()
          / ((double) (gadget_.getK() - 1)))) {
        // implicit weights in sketchIn are light enough to merge into gadget
        twoWayMergeInternalWeighted(sketchIn);
      } else {
        // Use next line as an assert/exception?
        // gadget_.getImplicitSampleWeight() < sketchIn.getN() / ((double) (sketchIn.getK() - 1))) {
        // implicit weights in gadget are light enough to merge into sketchIn
        // merge into sketchIn, so swap first
        final ReservoirItemsSketch<T> tmpSketch = gadget_;
        gadget_ = (isModifiable ? sketchIn : sketchIn.copy());
        twoWayMergeInternalWeighted(tmpSketch);
      }
    }
docs: This either merges sketchIn into gadget_ or gadget_ into sketchIn. If merging into sketchIn
  with isModifiable set to false, copies elements from sketchIn first, leaving original
  unchanged.
  
  @param sketchIn Sketch with new samples from which to draw
  @param isModifiable Flag indicating whether sketchIn can be modified (e.g. if it was rebuild
  from Memory)