Would an iteration using the bitSet make sense here? That seems like it should be a little more efficient assuming the bitSet's iteration is faster than checking every bit explicitly.