### Question:
HashUtils { public static String sha1(String message) { return hash(message, MessageDigestAlgorithm.SHA1); } 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 shouldHashSha1() { String[] correctHashes = { "da39a3ee5e6b4b0d3255bfef95601890afd80709", "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", "285d0c707f9644b75e1a87a62f25d0efb56800f0", "a42ef8e61e890af80461ca5dcded25cbfcf407a4" }; List<String> result = new ArrayList<>(); for (String password : GIVEN_PASSWORDS) { result.add(HashUtils.sha1(password)); } assertThat(result, contains(correctHashes)); }