I'm not sure this test goes quite far enough.  This test validates that we're using the bytes in the buffer vs the character count...not that the encoding was applied.  To see my point, in the TransactionAwareBufferedWriter#getBufferSize(), remove the encoding from the getBytes call and the test still passes (which I would think it shouldn't).