vvcephei commented on a change in pull request #10810: URL: https://github.com/apache/kafka/pull/10810#discussion_r645024604
########## File path: streams/test-utils/src/main/java/org/apache/kafka/streams/processor/MockProcessorContext.java ########## @@ -319,7 +321,7 @@ public void setRecordMetadata(final String topic, this.topic = topic; this.partition = partition; this.offset = offset; - this.headers = headers; + this.headers = Objects.requireNonNull(headers); Review comment: If you want to introduce the invariant without introducing an NPE regression, you could just coerce a null: ```suggestion this.headers = headers == null ? new RecordHeaders() : headers; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org