### Question:
AllShowBitMap extends RangeBitmap { public static ImmutableBitMap of(int rowCount) { return new AllShowBitMap(rowCount); } private  AllShowBitMap(int rowCount); static ImmutableBitMap of(int rowCount); @Override byte[] toBytes(); @Override ImmutableBitMap getAnd(ImmutableBitMap index); @Override ImmutableBitMap getOr(ImmutableBitMap index); @Override ImmutableBitMap getAndNot(ImmutableBitMap index); @Override ImmutableBitMap getNot(int bound); @Override ImmutableBitMap clone(); @Override BitMapType getType();  }### Answer:
@Test public void of() { ImmutableBitMap bitmap = AllShowBitMap.of(100); Assert.assertEquals(100, bitmap.getCardinality()); for (int i = 0; i < 100; i++) { Assert.assertTrue(bitmap.contains(i)); } }
@Test public void writeBytes() throws Exception { OutputStream output = mock(OutputStream.class); mockStatic(IoUtil.class); AllShowBitMap.of(1).writeBytes(output); ByteBuffer buf = ByteBuffer.allocate(5) .order(ByteOrder.LITTLE_ENDIAN) .put(BitMapType.ALL_SHOW.getHead()) .putInt(1); verify(output).write(buf.array()); doThrow(new IOException()).when(output).write(any(byte[].class)); AllShowBitMap.of(1).writeBytes(output); verifyStatic(IoUtil.class, times(2)); IoUtil.close(output); }