@Test
public void test3ByteEncodings() {

    StringBuilder sb = new StringBuilder();
    for (int i=0x800; i<0x800+100; i++) {
        sb.append((char)i);
    }
    // remove a total of 3 3-byte characters, and then add back in the 1-byte '#'
    String result = ClassFileNameHandler.shortenPathComponent(sb.toString(), 6);
    Assert.assertEquals(300, sb.toString().getBytes(UTF8).length);
    Assert.assertEquals(292, result.getBytes(UTF8).length);
    Assert.assertEquals(98, result.length());
    // remove a total of 3 3-byte characters, and then add back in the 1-byte '#'
    result = ClassFileNameHandler.shortenPathComponent(sb.toString(), 7);
    Assert.assertEquals(300, sb.toString().getBytes(UTF8).length);
    Assert.assertEquals(292, result.getBytes(UTF8).length);
    Assert.assertEquals(98, result.length());
}