@Test
public void testParamsFormatting() throws Exception {

    final NameValuePair param1 = new BasicNameValuePair("param", "regular_stuff");
    final NameValuePair param2 = new BasicNameValuePair("param", "this\\that");
    final NameValuePair param3 = new BasicNameValuePair("param", "this,that");
    final NameValuePair[] params = new NameValuePair[] {param1, param2, param3};
    final CharArrayBuffer buf = new CharArrayBuffer(64);
    buf.clear();
    this.formatter.formatParameters(buf, params, false);
    Assert.assertEquals("param=regular_stuff; param=\"this\\\\that\"; param=\"this,that\"",
            buf.toString());
    buf.clear();
    this.formatter.formatParameters(buf, params, true);
    Assert.assertEquals("param=\"regular_stuff\"; param=\"this\\\\that\"; param=\"this,that\"",
            buf.toString());
}