public void merge(long thisBucket, HyperLogLogPlusPlus other, long otherBucket) {
Preconditions.checkArgument(p == other.p);
ensureCapacity(thisBucket + 1);
if (other.algorithm.get(otherBucket) == LINEAR_COUNTING) {
final IntArray values = other.hashSet.values(otherBucket);
try {
for (long i = 0; i < values.size(); ++i) {
final int encoded = values.get(i);
if (algorithm.get(thisBucket) == LINEAR_COUNTING) {
collectLcEncoded(thisBucket, encoded);
} else {
collectHllEncoded(thisBucket, encoded);
}