@Test
    public final void testUtf8Strings() {
        String nalle = "nalle";
        Utf8String utf = new Utf8String(new Utf8Array(Utf8.toBytes(nalle)));
        assertEquals('n', utf.charAt(0));
        assertEquals(nalle.length(), utf.length());
        assertEquals("alle", utf.subSequence(1, 5));
        assertTrue(utf.equals(new Utf8String(new Utf8Array(Utf8.toBytes(nalle)))));
        assertTrue(utf.equals(nalle));
    }
Check the Utf8Array API behaves as expected.

@author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a>
vespajlib/src/test/java/com/yahoo/text/Utf8ArrayTestCase.java