Source:
private static void checkHeaderAndStoreKeyForUpdate(InputStream stream, Long expectedRecordSize, StoreKey key) throws IOException, MessageFormatException { MessageFormatRecord.MessageHeader_Format header = MessageFormatRecordTest.getHeader(new DataInputStream(stream)); header.verifyHeader(); Assert.assertEquals("Version not as expected", MessageFormatRecord.headerVersionToUse, header.getVersion()); Assert.assertEquals("Update record relative offset not as expected", MessageFormatRecord.getHeaderSizeForVersion(MessageFormatRecord.headerVersionToUse) + key.sizeInBytes(), header.getUpdateRecordRelativeOffset()); if (expectedRecordSize != null) { Assert.assertEquals("Size of record not as expected", expectedRecordSize.longValue(), header.getMessageSize()); } Assert.assertEquals("Encryption key relative should be invalid", MessageFormatRecord.Message_Header_Invalid_Relative_Offset, header.getBlobEncryptionKeyRecordRelativeOffset()); Assert.assertEquals("Blob props relative offset should be invalid", MessageFormatRecord.Message_Header_Invalid_Relative_Offset, header.getBlobPropertiesRecordRelativeOffset()); Assert.assertEquals("UM relative offset should be invalid", MessageFormatRecord.Message_Header_Invalid_Relative_Offset, header.getUserMetadataRecordRelativeOffset()); Assert.assertEquals("Blob relative offset should be invalid", MessageFormatRecord.Message_Header_Invalid_Relative_Offset, header.getBlobRecordRelativeOffset()); byte[] keyBytes = Utils.readBytesFromStream(stream, key.sizeInBytes()); Assert.assertArrayEquals("StoreKey not as expected", key.toBytes(), keyBytes); }

Target:
private static void checkHeaderAndStoreKeyForUpdate(InputStream stream, Long expectedRecordSize, StoreKey key) throws IOException, MessageFormatException { MessageFormatRecord.MessageHeader_Format header = MessageFormatRecordTest.getHeader(new DataInputStream(stream)); header.verifyHeader(); Assert.assertEquals("Version not as expected", MessageFormatRecord.headerVersionToUse, header.getVersion()); Assert.assertEquals("Update record relative offset not as expected", MessageFormatRecord.getHeaderSizeForVersion(MessageFormatRecord.headerVersionToUse) + key.sizeInBytes(), header.getUpdateRecordRelativeOffset()); if (expectedRecordSize != null) { Assert.assertEquals("Size of record not as expected", expectedRecordSize.longValue(), header.getMessageSize()); } Assert.assertEquals("Encryption key relative offset should be invalid", MessageFormatRecord.Message_Header_Invalid_Relative_Offset, header.getBlobEncryptionKeyRecordRelativeOffset()); Assert.assertEquals("Blob props relative offset should be invalid", MessageFormatRecord.Message_Header_Invalid_Relative_Offset, header.getBlobPropertiesRecordRelativeOffset()); Assert.assertEquals("UM relative offset should be invalid", MessageFormatRecord.Message_Header_Invalid_Relative_Offset, header.getUserMetadataRecordRelativeOffset()); Assert.assertEquals("Blob relative offset should be invalid", MessageFormatRecord.Message_Header_Invalid_Relative_Offset, header.getBlobRecordRelativeOffset()); byte[] keyBytes = Utils.readBytesFromStream(stream, key.sizeInBytes()); Assert.assertArrayEquals("StoreKey not as expected", key.toBytes(), keyBytes); }