### Question:
PasswordHandler { public static String md5(String password) { MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("MD5 algorithm not available. Fatal (should be in the JDK)."); } try { byte[] bytes = digest.digest(password.getBytes("UTF-8")); return String.format("%032x", new BigInteger(1, bytes)); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("UTF-8 encoding not available. Fatal (should be in the JDK)."); } } private  PasswordHandler(); static String md5(String password);  }### Answer:
@Test public void testMd5() throws Exception { final String admin = PasswordHandler.md5("admin"); assertNotNull(admin); assertEquals(admin, "21232f297a57a5a743894a0e4a801fc3"); final String test = PasswordHandler.md5("test"); assertNotNull(test); assertEquals(test, "098f6bcd4621d373cade4e832627b4f6"); }