public static ByteBuffer getBlobContentForMetadataBlob(int blobSize) {
    ByteBuffer blobContent = ByteBuffer.allocate(blobSize);
    new Random().nextBytes(blobContent.array());
    int size = (int) MessageFormatRecord.Blob_Format_V3.getBlobRecordSize(blobSize);
    ByteBuffer entireBlob = ByteBuffer.allocate(size);
    MessageFormatRecord.Blob_Format_V3.serializePartialBlobRecord(entireBlob, blobSize, BlobType.MetadataBlob, false);
    entireBlob.put(blobContent);
    CRC32 crc = new CRC32();
    crc.update(entireBlob.array(), 0, entireBlob.position());
    entireBlob.putLong(crc.getValue());
    entireBlob.flip();
    return entireBlob;
  }
Creates a test data for metadata blob content, followed by creating the actual blob record V2
@param blobSize size of the metadata content
@return entire blob content as a {@link ByteBuffer}
ambry-messageformat/src/test/java/com/github/ambry/messageformat/MessageFormatTestUtils.java