### Question:
HashUtil { public static byte[] hashMD5(String str) { try { return hash("MD5", str); } catch (NoSuchAlgorithmException e) { log.error("The algorithm is not available" + " in the caller's environment.", e); return null; } }  static byte[] hash(String algorithm, String str); static byte[] hashMD5(String str); static byte[] hashSHA1(String str);  }### Answer:
@Test public void testHashMD501() throws Exception { String paramStr = "abc"; byte[] resultHashValue = HashUtil.hashMD5(paramStr); assertTrue( MessageDigest.isEqual( MessageDigest.getInstance("MD5").digest("abc".getBytes()), resultHashValue)); }
@Test public void testHashMD502() throws Exception { String paramStr = "あいう"; byte[] resultHashValue = HashUtil.hashMD5(paramStr); assertTrue( MessageDigest.isEqual( MessageDigest.getInstance("MD5").digest("あいう".getBytes()), resultHashValue)); }
@Test public void testHashMD503() throws Exception { String paramStr = ""; byte[] resultHashValue = HashUtil.hashMD5(paramStr); assertTrue( MessageDigest.isEqual( MessageDigest.getInstance("MD5").digest("".getBytes()), resultHashValue)); }
@Test public void testHashMD504() throws Exception { String paramStr = null; byte[] resultHashValue = HashUtil.hashMD5(paramStr); assertNull(resultHashValue); }