### Question:
FileHelper { public static String shortenStringViaMD5Hash(final String longString) { try { final MessageDigest messageDigest = MessageDigest.getInstance("MD5"); messageDigest.update(longString.getBytes()); final byte[] hash = messageDigest.digest(); final StringBuilder sb = new StringBuilder(2*hash.length); for(final byte b : hash){ sb.append(String.format("%02x", b&0xff)); } return sb.toString(); } catch (final NoSuchAlgorithmException e) { LOG.error("MessageDigest algorithm MD5 not supported. String '{}' will not be shortened.",longString); LOG.debug("Exception thrown: {}", e.getMessage(), e); return longString; } }  static File createFileInImporterHomeWithUniqueFileName(final String fileName); static String cleanPathToCreateFileName(final String fileName); static String shortenStringViaMD5Hash(final String longString); static File getHome();  }### Answer:
@Test public void shouldShortenALongString() { final String longString = "This is a very long string that should be shortened to a shorter one"; final String shorterString = FileHelper.shortenStringViaMD5Hash(longString); assertThat(shorterString.length(),is(32)); assertThat(shorterString,is("c42073bd88ccb323a36b57092093b139")); }