public static int byteSize(HyperLogLog value) {
    // 8 bytes header (log2m & register set size) & register set data
    return value.sizeof() + 2 * Integer.BYTES;
  }
@Test
  public void testByteSize()
      throws IOException {
    for (int log2m = 0; log2m < 16; log2m++) {
      HyperLogLog hll = new HyperLogLog(log2m);
      int expectedByteSize = hll.getBytes().length;
      assertEquals(HyperLogLogUtils.byteSize(log2m), expectedByteSize);
      assertEquals(HyperLogLogUtils.byteSize(hll), expectedByteSize);
    }
  }