### Question:
Security { public static String encodeString(String strToEncode) throws APIException { String algorithm = "SHA-512"; MessageDigest md; byte[] input; try { md = MessageDigest.getInstance(algorithm); input = strToEncode.getBytes(StandardCharsets.UTF_8); } catch (NoSuchAlgorithmException e) { log.error(getPasswordEncodeFailMessage(algorithm), e); throw new APIException("system.cannot.find.password.encryption.algorithm", null, e); } return hexString(md.digest(input)); } private  Security(); static boolean hashMatches(String hashedPassword, String passwordToHash); static String encodeString(String strToEncode); static String getRandomToken(); static String encrypt(String text, byte[] initVector, byte[] secretKey); static String encrypt(String text); static String decrypt(String text, byte[] initVector, byte[] secretKey); static String decrypt(String text); static byte[] getSavedInitVector(); static byte[] generateNewInitVector(); static byte[] getSavedSecretKey(); static byte[] generateNewSecretKey();  }### Answer:
@Test public void encodeString_shouldEncodeStringsTo128Characters() { String hash = Security.encodeString("test" + "c788c6ad82a157b712392ca695dfcf2eed193d7f"); Assert.assertEquals(HASH_LENGTH, hash.length()); }