Util.resetBitmapRange(answer.bitmap, lastPos, start);
Util.flipBitmapRange(answer.bitmap, start, end);
answer.updateCardinality(prevOnes + flippedOnes, end - start - flippedOnes);
lastPos = end;
}
<BUG>int prevOnes = Util.cardinalityInBitmapRange(answer.bitmap, lastPos, BitmapContainer.MAX_CAPACITY);
</BUG>
Util.resetBitmapRange(answer.bitmap, lastPos, BitmapContainer.MAX_CAPACITY);
<BUG>answer.updateCardinality(prevOnes, 0);
</BUG>
if (answer.getCardinality() > ArrayContainer.DEFAULT_MAX_SIZE) {

Util.resetBitmapRange(answer.bitmap, lastPos, start);
Util.flipBitmapRange(answer.bitmap, start, end);
answer.updateCardinality(prevOnes + flippedOnes, end - start - flippedOnes);
lastPos = end;
}
int ones = Util.cardinalityInBitmapRange(answer.bitmap, lastPos, BitmapContainer.MAX_CAPACITY);
Util.resetBitmapRange(answer.bitmap, lastPos, BitmapContainer.MAX_CAPACITY);
answer.updateCardinality(ones, 0);
if (answer.getCardinality() > ArrayContainer.DEFAULT_MAX_SIZE) {
