### Question:
HashShaLockedDomainPrefixGenerator implements LockedDomainPrefixGenerator { public String getLockedDomainPrefix(Uri gadgetUri) { byte[] sha1 = DigestUtils.sha(gadgetUri.toString()); return new String(Base32.encodeBase32(sha1)); }  String getLockedDomainPrefix(Uri gadgetUri);  }### Answer:
@Test public void generate() { Uri uri = Uri.parse("http: assertEquals("e5bld32ce9pe5ln81rjhe0d0e1vao1ba", generator.getLockedDomainPrefix(uri)); }
@Test(expected = NullPointerException.class) public void isNull() { generator.getLockedDomainPrefix(null); }