### Question:
RoaringInspection { public static long sizeInBits(RoaringBitmap bitmap) { int pos = bitmap.highLowContainer.size() - 1; if (pos >= 0) { return (toIntUnsigned(bitmap.highLowContainer.getKeyAtIndex(pos)) + 1) << 16; } else { return 0; } } private  RoaringInspection(); static RoaringBitmap[] split(RoaringBitmap bitmap); static RoaringBitmap join(RoaringBitmap[] split); static RoaringBitmap[] extract(RoaringBitmap bitmap, int[] ukeys); static void optimize(RoaringBitmap bitmap, int[] ukeys); static int lastSetBit(RoaringBitmap bitmap); static long sizeInBits(RoaringBitmap bitmap); static void cardinalityInBuckets(RoaringBitmap bitmap, int[][] indexes, long[][] buckets); static int key(int position); static int[] keys(RoaringBitmap bitmap); static int[] keysNotEqual(RoaringBitmap x1, RoaringBitmap x2); static int[] userialize(RoaringBitmap bitmap, DataOutput[] outContainers); static boolean[] userializeAtomized(RoaringBitmap index, int[] ukeys, DataOutput[] dataOutputs); static short[] serialize(RoaringBitmap bitmap, DataOutput[] outContainers); static long[] serializeSizeInBytes(RoaringBitmap bitmap, int[] ukeys); static boolean udeserialize(BitmapAndLastId<RoaringBitmap> result, StreamAtoms streamAtoms); static int lastSetBit(int ukey, DataInput inContainer); static short intToShortKey(int ukey); static short[] intToShortKeys(int[] ukeys); static int shortToIntKey(short key); static int[] shortToIntKeys(short[] keys); static int containerCount(RoaringBitmap bitmap); static int naiveFirstIntersectingBit(RoaringBitmap x1, RoaringBitmap x2); static int firstIntersectingBit(RoaringBitmap x1, RoaringBitmap x2);  }### Answer:
@Test public void testSizeInBits() throws Exception { RoaringBitmap bitmap = new RoaringBitmap(); assertEquals(RoaringInspection.sizeInBits(bitmap), 0); bitmap.add(0); assertEquals(RoaringInspection.sizeInBits(bitmap), 1 << 16); bitmap.add(1 << 16 - 1); assertEquals(RoaringInspection.sizeInBits(bitmap), 1 << 16); bitmap.add(1 << 16); assertEquals(RoaringInspection.sizeInBits(bitmap), 2 << 16); bitmap.add(2 << 16 - 1); assertEquals(RoaringInspection.sizeInBits(bitmap), 2 << 16); bitmap.add(2 << 16); assertEquals(RoaringInspection.sizeInBits(bitmap), 3 << 16); }