@Test
    public void testDecodePartialMultibyteStringInSteps() throws Exception
    {
        final byte[] multibyteCharacter = "\u3053\u308C".getBytes(StandardCharsets.UTF_8); // two 3-byte characters.
        assert multibyteCharacter.length == 6;
        final XMLLightweightParser parser = new XMLLightweightParser();
        final ByteBuf in = ByteBufAllocator.DEFAULT.buffer(10);

        // Execute system under test.
        in.writeBytes(Arrays.copyOfRange(multibyteCharacter, 0, 2));
        parser.decode(in);
        in.writeBytes(Arrays.copyOfRange(multibyteCharacter, 2, 6));
        final char[] result = parser.decode(in);

        // Verify results.
        assertEquals(2, result.length);
        assertEquals('\u3053', result[0]);
        assertEquals('\u308C', result[1]);
        assertEquals(6, in.readerIndex());
    }
Verifies that {@link XMLLightweightParser#decode(ByteBuf)} can read a string of multi-byte characters, even if
their bytes are provided to the decoder in chunks that do not correspond with the character boundaries.

@see <a href="https://igniterealtime.atlassian.net/browse/OF-458">issue OF-458: XMPPDecoder has a decode problem for UTF-8</a>
@see <a href="https://igniterealtime.atlassian.net/browse/OF-2814">issue OF-2814: Issue with cyrilic (any multi-byte?) characters in messages</a>
xmppserver/src/test/java/org/jivesoftware/openfire/nio/XMLLightweightParserTest.java