MD5 { public static byte[] hash(byte[] source) { try { MessageDigest digest = MessageDigest.getInstance("MD5"); return digest.digest(source); } catch (NoSuchAlgorithmException e) { logger.error("Failed to find MD5"); } return null; }  static byte[] hash(byte[] source); static byte[] hash(BigInteger num);  }
@Test public void testMd5() { byte[] hash = MD5.hash(TestConstants.msg.getBytes()); Assert.assertEquals(TestConstants.md5HashedBase64Msg, Base64.encodeToString(hash)); }