@Test
    public final void testCompareTo() {
        assertTrue(toCheck.compareTo(new Utf8Array(new byte[] {})) > 0);
        assertTrue(toCheck.compareTo(new Utf8Array(Utf8.toBytes(raw + raw))) < 0);
        assertTrue(toCheck.compareTo(new Utf8Array(Utf8.toBytes(" " + raw.substring(1)))) > 0);
        assertTrue(toCheck.compareTo(new Utf8Array(Utf8.toBytes("a" + raw.substring(1)))) < 0);
        assertTrue(toCheck.compareTo(new Utf8Array(rawBytes)) == 0);
    }
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