### Question:
InsecureHashingMessageUtil { public static String getHashMD5(String source) { if (source == null) { LOG.debug("Hashing: null value received for hashing"); return null; } LOG.debug("Hash MD5: source {}", source); byte[] bytesOfSource; MessageDigest messageDigest; byte[] hash; try { bytesOfSource = source.getBytes(sourceEncoding); } catch (UnsupportedEncodingException e) { LOG.error("Source encoding not supported: {}", sourceEncoding); return null; } try { messageDigest = MessageDigest.getInstance(md5Algorithm); } catch (NoSuchAlgorithmException e) { LOG.error("Algorithm not supported: {}", md5Algorithm); return null; } hash = messageDigest.digest(bytesOfSource); final StringBuilder stringBuilder = new StringBuilder(hash.length * 2); for (byte hashByte : hash) { stringBuilder.append(Integer.toHexString((hashByte & 0xFF) | 0x100).substring(1, 3)); } LOG.debug("Hash MD5: hash {}", stringBuilder.toString()); return stringBuilder.toString(); }  static String getHashMD5(String source);  }### Answer:
@Test public void testHashValue_NormalString() { String hash = InsecureHashingMessageUtil.getHashMD5("{\"fname\":\"Mango\",\"fcolor\":\"Yellow\",\"ftaste\":\"Sweet\",\"kylo_schema\":\"fruit_items\",\"kylo_table\":\"fruits_feed_01\"}"); Assert.assertEquals("de66d7905e2c92cb205e4070e101038f", hash); log.info("Test hash for normal string: OK"); }
@Test public void testHashValue_NullString() { String hash = InsecureHashingMessageUtil.getHashMD5(null); Assert.assertNull(hash); log.info("Test hash for null string: OK"); }
@Test public void testHashValue_EmptyString() { String hash = InsecureHashingMessageUtil.getHashMD5(""); Assert.assertEquals("d41d8cd98f00b204e9800998ecf8427e", hash); log.info("Test hash for empty string: OK"); }