If I don't use special (UTF-8 multi byte) characters, the test would still pass with the old code that just returned getCurrentBuffer().length().