@Test
    public final void testWriteTo() {
        ByteBuffer b = ByteBuffer.allocate(rawBytes.length * 2);
        byte[] copy = new byte[rawBytes.length];
        toCheck.writeTo(b);
        assertEquals(rawBytes.length, b.position());
        b.position(0);
        b.limit(rawBytes.length);
        b.get(copy);
        assertArrayEquals(rawBytes, copy);
    }
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