public static byte[] getSketchFromByteBuffer(@Nullable ByteBuffer bf) {
    if (bf == null) {
      return new byte[0];
    } else {
      byte[] result = new byte[bf.remaining()];
      bf.get(result);
      return result;
    }
  }
@Test
  public void testGetSketchFromByteBufferForEmptySketch() {
    assertArrayEquals(HllCount.getSketchFromByteBuffer(null), EMPTY_SKETCH);
  }