### Question:
SHA1 { public static String hex(byte[] bytes) { return StringUtils.encodeHex(bytes(bytes)); }  static synchronized byte[] bytes(byte[] bytes); static byte[] bytes(String string); static String hex(byte[] bytes); static String hex(String string);  }### Answer:
@Test public void testHash() { try { SHA1.hex((String) null); fail(); } catch (NullPointerException npe) { assertTrue(true); } String result = SHA1.hex(""); assertEquals("da39a3ee5e6b4b0d3255bfef95601890afd80709", result); String adminInHash = "d033e22ae348aeb5660fc2140aec35850c4da997"; result = SHA1.hex("admin"); assertEquals(adminInHash, result); String random = "jive software blah and stuff this is pretty cool"; result = SHA1.hex(random); assertTrue(isValidHash(result)); String junk = "\n\n\t\b\r!@(!)^(#)@+_-\u2031\u09291\u00A9\u00BD\u0394\u00F8"; result = SHA1.hex(junk); assertTrue(isValidHash(result)); }