@Test
    public void testOF2814MultiByteCharactersInTwoPasses() throws Exception
    {
        // Setup test fixture.
        final String input = "<message to='foo@example.org'><body>\u3053\u308C\u306F\u30DE\u30EB\u30C1\u30D0\u30A4\u30C8\u6587\u5B57\u3092\u542B\u3080\u30C6\u30B9\u30C8 \u30D9\u30AF\u30C8\u30EB\u3067\u3059\u3002</body></message>";
        final byte[] inputBytes = input.getBytes(StandardCharsets.UTF_8);
        final int snip = 36 + 3 + 2; // First 36 bytes correspond to the ASCII prefix. Then, various three-byte characters follow. We want to break in the middle of a character for this test.
        ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer(inputBytes.length);
        buffer.writeBytes(Arrays.copyOfRange(inputBytes, 0, snip));
        final XMLLightweightParser parser = new XMLLightweightParser();

        // Execute system under test.
        parser.read(buffer);
        buffer.writeBytes(Arrays.copyOfRange(inputBytes, snip, inputBytes.length));
        parser.read(buffer);

        final String[] result = parser.getMsgs();

        // Verify results.
        assertNotNull( result );
        assertEquals(1, result.length );
    }
Asserts that {@link XMLLightweightParser} can parse a stanza that contains multi-byte characters, when the bytes
are provided in two arrays, that together make up the full string, even when the arrays are split in such a way
that one of the multi-byte characters is on the end of the first array, while its other bytes are at the start of
the next array.

@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