MessageListenerThread extends Thread { String header(Headers headers, String key) { Header header = headers.lastHeader(key); if (header == null) return null; return new String(header.value(), UTF_8); } MessageListenerThread(String name, MessageListener listener); @Override void run();  }
@Test void header() { var headers = new RecordHeaders(); headers.add("header", Strings.bytes("value")); assertThat(thread.header(headers, "header")).isEqualTo("value"); assertThat(thread.header(headers, "nonExisted")).isNull(); }