class EncodeUTF8Benchmark {
    static String STR = "01234567890ABCDEFGHIJKLMNOPQRSTUVWZYZabcdefghijklmnopqrstuvwzyz一二三四五六七八九十";
    static byte[] out;

    static long valueFieldOffset;

    static {
        out = new byte[STR.length() * 3];
        try {
            Field valueField = String.class.getDeclaredField("value");
            valueFieldOffset = UNSAFE.objectFieldOffset(valueField);
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        }
    }

    @Benchmark
    public int unsafeEncodeUTF8() throws Exception {
        char[] chars = (char[]) UNSAFE.getObject(STR, valueFieldOffset);
        return IOUtils.encodeUTF8(chars, 0, chars.length, out, 0);
    }

    @Benchmark
    public byte[] getBytesUTF8() throws Exception {
        byte[] bytes = STR.getBytes(StandardCharsets.UTF_8);
        System.arraycopy(bytes, 0, out, 0, bytes.length);
        return out;
    }

    public static void main(String[] args) throws RunnerException {<FILL_FUNCTION_BODY>}
}

        Options options = new OptionsBuilder()
                .include(EncodeUTF8Benchmark.class.getName())
                .mode(Mode.Throughput)
                .timeUnit(TimeUnit.MILLISECONDS)
                .forks(1)
                .build();
        new Runner(options).run();
    
<no_super_class>