@Override
            public byte[] serialize(final String topic, final Comment data) {
                final byte[] serialText = stringSerde.serializer().serialize(topic, data.text);

                final int length = Integer.BYTES + Long.BYTES + (Integer.BYTES + serialText.length) + Integer.BYTES;

                final ByteBuffer buffer =
                    ByteBuffer.allocate(length)
                        .putInt(data.key)
                        .putLong(data.timestamp)
                        .putInt(serialText.length)
                        .put(serialText)
                        .putInt(data.articleId);

                return Serdes.ByteBuffer().serializer().serialize(topic, buffer);
            }
This test builds on a basic relational data caricature:
a set of articles, each with a set of comments on them.
<p>
The particular relation in this data is that each Comment
has an articleId foreign-key reference to an Article.
<p>
We traverse this relation in both directions to verify
correct operation of Kafka Streams:
- Embed on each Comment a prefix of the text in the Article it references
aka SELECT * FROM Comment JOIN Article ON Comment.ArticleID = Article.ID
- Embed on each Article a count of all the Comments it has
streams/src/test/java/org/apache/kafka/streams/tests/RelationalSmokeTest.java