static void replaceHeader(Headers headers, String key, String value) {
    try {
      headers.remove(key);
      headers.add(key, value.getBytes(UTF_8));
    } catch (IllegalStateException e) {
      log(e, "error setting header {0} in headers {1}", key, headers);
    }
  }
@Test void replaceHeader_readonly() {
    ((RecordHeaders) record.headers()).setReadOnly();
    KafkaHeaders.replaceHeader(record.headers(), "b3", "1");
  }