@Test
public void test2ByteEncodings() {

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