public WAH8DocIdSet CopyOf(OpenBitSet bs, int length)
{
int indexInterval = TestUtil.NextInt32(Random, 8, 256);
WAH8DocIdSet.Builder builder = (WAH8DocIdSet.Builder)(new WAH8DocIdSet.Builder()).SetIndexInterval(indexInterval);
for (int i = bs.NextSetBit(0); i != -1; i = bs.NextSetBit(i + 1))
{
builder.Add(i);
}
return(builder.Build());
}