### Question:
RoaringBufferInspection { public static long sizeInBits(ImmutableRoaringBitmap bitmap) { int pos = bitmap.highLowContainer.size() - 1; if (pos >= 0) { return (BufferUtil.toIntUnsigned(bitmap.highLowContainer.getKeyAtIndex(pos)) + 1) << 16; } else { return 0; } } private  RoaringBufferInspection(); static long sizeInBits(ImmutableRoaringBitmap bitmap); static void cardinalityInBuckets(ImmutableRoaringBitmap bitmap, int[][] indexes, long[][] buckets);  }### Answer:
@Test public void testSizeInBits() throws Exception { MutableRoaringBitmap bitmap = new MutableRoaringBitmap(); assertEquals(RoaringBufferInspection.sizeInBits(bitmap), 0); bitmap.add(0); assertEquals(RoaringBufferInspection.sizeInBits(bitmap), 1 << 16); bitmap.add(1 << 16 - 1); assertEquals(RoaringBufferInspection.sizeInBits(bitmap), 1 << 16); bitmap.add(1 << 16); assertEquals(RoaringBufferInspection.sizeInBits(bitmap), 2 << 16); bitmap.add(2 << 16 - 1); assertEquals(RoaringBufferInspection.sizeInBits(bitmap), 2 << 16); bitmap.add(2 << 16); assertEquals(RoaringBufferInspection.sizeInBits(bitmap), 3 << 16); }