private void checkKey(String key) {
        Objects.requireNonNull(key, "Header key cannot be null");
    }
Check that the key is not null

@param key the key; may not be null
@throws NullPointerException if the supplied key is null
connect/api/src/main/java/org/apache/kafka/connect/header/ConnectHeaders.java