static void appendBits(Bits a, Bits b) { int n = a.n; BitSet bs = b.bs, bs2 = a.bs; for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i+1)) bs2.set(n+i); a.n += b.n; }