@Test
    public void testDecodeAllByteOfMultibyteCharInSteps() throws Exception
    {
        // Setup test fixture.
        final byte[] multibyteCharacter = "\u3053".getBytes(StandardCharsets.UTF_8); // 3-byte character.
        assert multibyteCharacter.length == 3;
        final XMLLightweightParser parser = new XMLLightweightParser();
        final ByteBuf in = ByteBufAllocator.DEFAULT.buffer(3);

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

        // Verify results.
        assertEquals(1, result.length);
        assertEquals(3, in.readerIndex());
    }
Verifies that {@link XMLLightweightParser#decode(ByteBuf)} eventually reads an entire multi-byte character, even
if it is provided to the method in pieces.

@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