static String trimTrailingEols(String message) {
        return message == null ? null : TRAILING_EOLS_PATTERN.matcher(message).replaceFirst("");
    }
@Test
    void trimTrailingEols() {
        Assertions.assertEquals(null, ClientDispatcher.trimTrailingEols(null));
        Assertions.assertEquals("foo", ClientDispatcher.trimTrailingEols("foo"));
        Assertions.assertEquals("foo\nbar", ClientDispatcher.trimTrailingEols("foo\nbar"));
        Assertions.assertEquals("foo\nbar", ClientDispatcher.trimTrailingEols("foo\nbar\n"));
        Assertions.assertEquals("foo\nbar", ClientDispatcher.trimTrailingEols("foo\nbar\r\n"));
        Assertions.assertEquals("foo\nbar", ClientDispatcher.trimTrailingEols("foo\nbar\n\r\n"));
        Assertions.assertEquals("", ClientDispatcher.trimTrailingEols("\n"));
    }