sjhajharia commented on code in PR #19869: URL: https://github.com/apache/kafka/pull/19869#discussion_r2123416469
########## connect/api/src/test/java/org/apache/kafka/connect/header/ConnectHeadersTest.java: ########## @@ -380,9 +381,9 @@ public void shouldValidateBuildInTypes() { assertSchemaMatches(Schema.FLOAT64_SCHEMA, 1.0d); assertSchemaMatches(Schema.STRING_SCHEMA, "value"); assertSchemaMatches(SchemaBuilder.array(Schema.STRING_SCHEMA), new ArrayList<String>()); - assertSchemaMatches(SchemaBuilder.array(Schema.STRING_SCHEMA), Collections.singletonList("value")); + assertSchemaMatches(SchemaBuilder.array(Schema.STRING_SCHEMA), List.of("value")); assertSchemaMatches(SchemaBuilder.map(Schema.STRING_SCHEMA, Schema.INT32_SCHEMA), new HashMap<String, Integer>()); - assertSchemaMatches(SchemaBuilder.map(Schema.STRING_SCHEMA, Schema.INT32_SCHEMA), Collections.singletonMap("a", 0)); + assertSchemaMatches(SchemaBuilder.map(Schema.STRING_SCHEMA, Schema.INT32_SCHEMA), Map.of("a", 0)); Review Comment: It was leading to NPEs. The elements in the List may be null. Hence it must be kept as Arrays.asList. -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org