class HugeAtomicBitSet {

    public BitSet toBitSet() {
        if (bits.size() <= MAX_ARRAY_LENGTH) {
            return new BitSet(((HugeAtomicLongArray.SingleHugeAtomicLongArray) bits).page(), (int) bits.size());
        }
        throw new UnsupportedOperationException(formatWithLocale(
            "Cannot convert HugeAtomicBitSet with more than %s entries.",
            MAX_ARRAY_LENGTH
        ));
    }

    private  HugeAtomicBitSet(HugeAtomicLongArray bits, long numBits);

}