question: private void twoWayMergeInternal ( final ReservoirLongsSketch sketchIn , final boolean isModifiable ) { if ( sketchIn . getN ( ) <= sketchIn . getK ( ) ) { twoWayMergeInternalStandard ( sketchIn ) ; } else if ( gadget_ . getN ( ) < gadget_ . getK ( ) ) { final ReservoirLongsSketch tmpSketch = gadget_ ; gadget_ = ( isModifiable ? sketchIn : sketchIn . copy ( ) ) ; twoWayMergeInternalStandard ( tmpSketch ) ; } else if ( sketchIn . getImplicitSampleWeight ( ) < gadget_ . getN ( ) / ( ( double ) ( gadget_ . getK ( ) - 1 ) ) ) { twoWayMergeInternalWeighted ( sketchIn ) ; } else { final ReservoirLongsSketch tmpSketch = gadget_ ; gadget_ = ( isModifiable ? sketchIn : sketchIn . copy ( ) ) ; twoWayMergeInternalWeighted ( tmpSketch ) ; } }
target:  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.