### Question:
HexString { public static String encodeHexString( byte[] bytes ) { char[] hexChars = new char[bytes.length * 2]; for ( int j = 0; j < bytes.length; j++ ) { int v = bytes[j] & 0xFF; hexChars[j * 2] = hexArray[v >>> 4]; hexChars[j * 2 + 1] = hexArray[v & 0x0F]; } return new String( hexChars ); } private  HexString(); static String encodeHexString( byte[] bytes ); static byte[] decodeHexString( String hexString );  }### Answer:
@Test void shouldEncodeBytesToString() { String result = HexString.encodeHexString( new byte[]{(byte) 0xFF, (byte) 0x94, (byte) 0x5C, (byte) 0x00, (byte) 0x3D} ); assertEquals( "FF945C003D", result ); }
@Test void shouldEncodeEmptyBytesToEmptyString() { String result = HexString.encodeHexString( new byte[]{} ); assertEquals( "", result ); }