### Question:
B2StringUtil { public static byte [] getUtf8Bytes(String str) { try { return str.getBytes(UTF8); } catch (UnsupportedEncodingException e) { throw new RuntimeException("No UTF-8 charset"); } } B2StringUtil(); static String percentEncode(String s); static String percentDecode(String s); static int decimalSubstringToInt(String s, int startIndex, int endIndex); static boolean decimalNumberInRange(String str, int offset, int length,
                                               int minInclusive, int maxInclusive); static String join(String delimiter, Object[] objects); static byte [] getUtf8Bytes(String str); static String toHexString(byte[] b); static String underscoresToCamelCase(String orig, boolean capitalizeFirstLetter); static boolean startsWithIgnoreCase(String all, String possiblePrefix); static final String UTF8; }### Answer:
@Test public void testGetUtf8Bytes() { assertArrayEquals(new byte[0], getUtf8Bytes("")); assertArrayEquals(new byte[] { 97, 98, 99 }, getUtf8Bytes("abc")); assertArrayEquals(new byte[] { (byte) 0xc3, (byte) 0xa2, (byte) 0xc6, (byte) 0x83, (byte) 0xc3, (byte) 0xa7 }, getUtf8Bytes("âƃç")); }