### Question:
HashUtils { public static MessageDigest getDigest(MessageDigestAlgorithm algorithm) { try { return MessageDigest.getInstance(algorithm.getKey()); } catch (NoSuchAlgorithmException e) { throw new UnsupportedOperationException("Your system seems not to support the hash algorithm '" + algorithm.getKey() + "'"); } } private  HashUtils(); static String sha1(String message); static String sha256(String message); static String sha512(String message); static String md5(String message); static MessageDigest getDigest(MessageDigestAlgorithm algorithm); static boolean isValidBcryptHash(String hash); static String hash(String message, MessageDigest algorithm);  }### Answer:
@Test public void shouldRetrieveMd5Instance() { MessageDigestAlgorithm algorithm = MessageDigestAlgorithm.MD5; MessageDigest digest = HashUtils.getDigest(algorithm); assertThat(digest.getAlgorithm(), equalTo("MD5")); }