### Question:
PasswordService { public String createMD5(String password) { if (password == null) { return null; } MessageDigest md; String result = null; try { md = MessageDigest.getInstance("MD5"); md.update(fromHex(PasswordService.SALT)); byte[] bytes = md.digest(password.getBytes()); StringBuilder sb = new StringBuilder(); for (byte aByte : bytes) { sb.append(Integer.toString((aByte & 0xff) + 0x100, 16).substring(1)); } result = sb.toString(); } catch (NoSuchAlgorithmException ignore) {} return result; } PasswordService(); void setupPasswordToUser(final Player player, final String password); boolean isPasswordValid(final Player player, final String pwHashToCheck); String createMD5(String password); static final String SALT; }### Answer:
@Test public void createMD5() { PasswordService cut = new PasswordService(); assertThat(cut.createMD5("123456"), Is.is("6dbeca3ec141a1759896c9e191fd2dca")); }