### Question:
ScriptUtils { public static String getMD5scriptHash(String script) { byte[] bytesOfScript = new byte[0]; try { bytesOfScript = script.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("UTF-8 appears to be an unsupported character set on this platform", e); } MessageDigest md = null; try { md = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("Unable to locate MD5 hash algorithm", e); } md.reset(); md.update(bytesOfScript); byte[] messageDigest = md.digest(); StringBuffer hexString = new StringBuffer(); for (int i = 0; i < messageDigest.length; i++) { String hex = Integer.toHexString(0xFF & messageDigest[i]); if (hex.length() == 1) { hexString.append('0'); } hexString.append(hex); } return hexString.toString(); } private  ScriptUtils(); static void writeToStream(final ResponseWriter responseWriter, Object obj); static String toScript(Object obj); static void appendScript(Appendable appendable, Object obj); static void appendEncodedString(Appendable appendable, Object obj); static void appendEncoded(Appendable appendable, Object obj); static String getValidJavascriptName(String script); static String getMD5scriptHash(String script); static boolean shouldRenderAttribute(Object attributeVal); static boolean shouldRenderAttribute(String attributeName, Object attributeVal); static boolean isValidProperty(Object property); static String escapeCSSMetachars(String s);  }### Answer:
@Test public void testGetMD5scriptHash() throws Exception { String testString = "Some string to hash"; String expectedMD5hash = "7624f3fd394f02f0ff8c53fac249129a"; String computedMD5hash = ScriptUtils.getMD5scriptHash(testString); assertEquals(expectedMD5hash, computedMD5hash); }