@Test
    public void decodeStartEndPositions() {
        byte[] foo = Utf8.toBytes("abcde");
        int start = 0;
        int length = foo.length;  //5
        int end = start + length;

        int[] indexes = calculateStringPositions(foo);
        int stringStart = indexes[start];
        int stringEnd = indexes[end];
        int stringLength = stringEnd - stringStart;

        assertThat(stringStart, equalTo(start));
        assertThat(stringEnd, equalTo(end));
        assertThat(stringLength, equalTo(length));
    }
@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