@Test
    public void testSimple() {
        String s1 = "test";
        String s2 = "f\u00F8rst";
        String s3 = "\u00C5pen";
        byte[] b4 = { (byte) 0xE5, (byte) 0xA4, (byte) 0x89, (byte) 0xE6,
                (byte) 0x85, (byte) 0x8B };

        byte[] b1 = Utf8.toBytes(s1);
        byte[] b2 = Utf8.toBytes(s2);
        byte[] b3 = Utf8.toBytes(s3);
        String s4 = Utf8.toString(b4);

        assertEquals('t', b1[0]);
        assertEquals('e', b1[1]);
        assertEquals('s', b1[2]);
        assertEquals('t', b1[3]);

        assertEquals('f', b2[0]);
        assertEquals((byte) 0xC3, b2[1]);
        assertEquals((byte) 0xB8, b2[2]);
        assertEquals('r', b2[3]);
        assertEquals('s', b2[4]);
        assertEquals('t', b2[5]);

        assertEquals((byte) 0xC3, b3[0]);
        assertEquals((byte) 0x85, b3[1]);
        assertEquals('p', b3[2]);
        assertEquals('e', b3[3]);
        assertEquals('n', b3[4]);

        assertEquals('\u5909', s4.charAt(0));
        assertEquals('\u614B', s4.charAt(1));

        String ss1 = Utf8.toString(b1);
        String ss2 = Utf8.toString(b2);
        String ss3 = Utf8.toString(b3);
        byte[] bb4 = Utf8.toBytes(s4);

        assertEquals(s1, ss1);
        assertEquals(s3, ss3);
        assertEquals(s2, ss2);
        assertEquals(Utf8.toString(b4), Utf8.toString(bb4));
    }
@author <a href="mailto:borud@yahoo-inc.com">Bjorn Borud</a>
@author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a>
vespajlib/src/test/java/com/yahoo/text/Utf8TestCase.java