@Test
  public void testMetadataContentRecordV3() throws IOException, MessageFormatException {
    // Test Metadata Blob V3
    int numKeys = 5;
    List<StoreKey> keys = getKeys(60, numKeys);
    List<Pair<StoreKey, Long>> keysAndContentSizes = new ArrayList<>();
    long total = 0;
    for (int i = 0; i < numKeys; i++) {
      long randNum = ThreadLocalRandom.current().nextLong(1, 10000000);
      total += randNum;
      keysAndContentSizes.add(new Pair<>(keys.get(i), randNum));
    }

    ByteBuffer metadataContent = getSerializedMetadataContentV3(total, keysAndContentSizes);
    CompositeBlobInfo compositeBlobInfo = deserializeMetadataContentV3(metadataContent, new MockIdFactory());
    Assert.assertEquals("Total size doesn't match", total, compositeBlobInfo.getTotalSize());
    Assert.assertEquals("List of keys dont match", keys, compositeBlobInfo.getKeys());
    List<CompositeBlobInfo.ChunkMetadata> list = compositeBlobInfo.getChunkMetadataList();
    Assert.assertEquals("ChunkMetadata and input list have different sizes", list.size(), keysAndContentSizes.size());
    long sum = 0;
    for (int i = 0; i < list.size(); i++) {
      Assert.assertEquals(keysAndContentSizes.get(i).getFirst(), list.get(i).getStoreKey());
      Assert.assertEquals((long) keysAndContentSizes.get(i).getSecond(), list.get(i).getSize());
      Assert.assertEquals(sum, list.get(i).getOffset());
      sum += list.get(i).getSize();
    }
  }
Tests UpdateRecord V3 for serialization and deserialization
@throws IOException
@throws MessageFormatException
ambry-messageformat/src/test/java/com/github/ambry/messageformat/MessageFormatRecordTest.java