@Test
    public final void testPartial() {
        final int length = 3;
        final int offset = 1;
        Utf8PartialArray partial = new Utf8PartialArray(rawBytes, offset, length);
        assertEquals(length, partial.getByteLength());
        assertEquals(offset, partial.getByteOffset());
        byte[] expected = new byte[length];
        ByteBuffer intermediate = ByteBuffer.allocate(rawBytes.length * 2);
        System.arraycopy(rawBytes, offset, expected, 0, length);
        partial.writeTo(intermediate);
        intermediate.flip();
        byte written[] = new byte[intermediate.remaining()];
        intermediate.get(written);
        assertArrayEquals(expected, written);
    }
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