@Test
public void testSLFormatting() throws Exception {

    final CharArrayBuffer buf = new CharArrayBuffer(64);
    final StatusLine statusline1 = new StatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
    this.formatter.formatStatusLine(buf, statusline1);
    Assert.assertEquals("HTTP/1.1 200 OK", buf.toString());
    buf.clear();
    final StatusLine statusline2 = new StatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, null);
    this.formatter.formatStatusLine(buf, statusline2);
    Assert.assertEquals("HTTP/1.1 200 ", buf.toString());
    // see "testSLParseSuccess" in TestBasicLineParser:
    // trailing space is correct
}