HexUtil { public static String convertStringToHexString(String data) { return conventBytesToHexString(data.getBytes()); }  static String convertStringToHexString(String data); static String conventBytesToHexString(byte[] data); static String convertBytesToHexString(byte[] data, int offset,
            int length); static String convertBytesToHexString(byte[] data, int offset,
            int length, String byteDelimiter); static String convertHexStringToString(String hexString); static byte[] convertHexStringToBytes(String hexString); static byte[] convertHexStringToBytes(String hexString, int offset,
            int endIndex);  }
@Test public void testEncode() { String res = HexUtil.convertStringToHexString("hello world"); assertEquals("68656c6c6f20776f726c64", res); }