MD5s { public static String toBase64(String hexMd5) { byte[] decodedHex = BaseEncoding.base16().lowerCase().decode(hexMd5); return BaseEncoding.base64().encode(decodedHex); }  static String toBase64(String hexMd5); static String toHex(String base64Md5); static boolean isBase64(String value); static boolean isHex(String value); static boolean isEqual(String firstMD5, String secondMD5);  }
@Test public void test_to_base64() { assertThat(MD5s.toBase64(MD5_HEX_1)).isEqualToIgnoringCase(MD5_BASE64_1); }
@Test(expected = IllegalArgumentException.class) public void test_to_base64_non_hex() { MD5s.toBase64(GARBAGE); }