@Test
  public void messageFormatUndeleteUpdateRecordTest() throws Exception {
    MessageFormatRecord.headerVersionToUse = MessageFormatRecord.Message_Header_Version_V3;
    StoreKey key = new MockId("id1");
    short accountId = Utils.getRandomShort(TestUtils.RANDOM);
    short containerId = Utils.getRandomShort(TestUtils.RANDOM);
    long updateTimeMs = SystemTime.getInstance().milliseconds() + TestUtils.RANDOM.nextInt();
    short lifeVersion = Utils.getRandomShort(TestUtils.RANDOM);
    MessageFormatInputStream messageFormatInputStream =
        new UndeleteMessageFormatInputStream(key, accountId, containerId, updateTimeMs, lifeVersion);
    long undeleteRecordSize = MessageFormatRecord.Update_Format_V3.getRecordSize(SubRecord.Type.UNDELETE);
    // Undelete record's version will start at least from V3.
    int headerSize = MessageFormatRecord.getHeaderSizeForVersion(MessageFormatRecord.Message_Header_Version_V3);
    Assert.assertEquals(headerSize + undeleteRecordSize + key.sizeInBytes(), messageFormatInputStream.getSize());
    checkUndeleteMessage(messageFormatInputStream, undeleteRecordSize, key, accountId, containerId, updateTimeMs,
        lifeVersion);
  }
Test for {@link UndeleteMessageFormatInputStream}.
@throws Exception
ambry-messageformat/src/test/java/com/github/ambry/messageformat/MessageFormatInputStreamTest.java