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_replace() {
    record.headers().add("b3", new byte[0]);
    KafkaHeaders.replaceHeader(record.headers(), "b3", "1");

    assertThat(record.headers().lastHeader("b3").value())
        .containsExactly('1');
  }