@Test
public void concatenateMessageWithItself() throws Descriptors.DescriptorValidationException {

    long kafkaOffset = 0L;
    DynamicMessage.Builder headerMessageBuilder = createHeaderMessageBuilder();
    Descriptors.Descriptor headerMsgDesc = headerMessageBuilder.getDescriptorForType();
    headerMessageBuilder.setField(headerMsgDesc.findFieldByName("id"), 1)
            .setField(headerMsgDesc.findFieldByName("name"), "one");
    Map<String, Object> expectedValues = new HashMap<>();
    expectedValues.put("id", 1);
    expectedValues.put("name", "one");
    expectedValues.put(ProtoConcatenator.TIMESTAMP_FIELD_NAME, 0L);
    expectedValues.put(ProtoConcatenator.KAFKA_OFFSET, kafkaOffset);
    // As of proto3, two fields cannot have the same name (even if they have a different id)
    Assert.assertNull(ProtoConcatenator.concatToProtobuf(0, 0,
            Arrays.asList(headerMessageBuilder.build(), headerMessageBuilder.build())));
}