### Question:
StringUtil { public static final String bytesToHexString(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; int v; for ( int j = 0; j < bytes.length; j++ ) { v = bytes[j] & 0xFF; hexChars[j*2] = HEX_CHARS[v/16]; hexChars[j*2 + 1] = HEX_CHARS[v%16]; } return new String(hexChars); }  static final String substring(String line, String start, String end); static final String substringR(String line, String start, String end); static final String concat(Object ... value ); static final int toInt(String str, int defaultValue); static final float toFloat(String str, float defaultValue); static final boolean checkNotEmpty(String str); static final void padStringRight(StringBuilder buf, String str, int length); static final String bytesToHexString(byte[] bytes); static final byte[] hexStringToBytes(String hexString); static final String[] splitMachineId(String machineId); static final Locale parseLocale(String languageTag, Locale defaultLocale); static final boolean checkValidEmail(String emailAddress); static String encryptSHA1(String data); static String encryptMD5(String data);  }### Answer:
@Test public void testByteToHex1() { byte[] array = {0x1, 0x2, 0x3, 0x4, 0x5, 0x10, 0x15, 0x20, 0x64, (byte)99, (byte)128, (byte)255}; String result = StringUtil.bytesToHexString(array); String expect = "0102030405101520646380FF"; assertEquals(expect, result); }