### Question:
HashPathIdMapper implements IdMapper { public String getInternalPrefix(String externalPrefix) throws NullPointerException { if (externalPrefix == null) { throw new NullPointerException(); } if (pattern.length() == 0) { StringBuilder buffer = new StringBuilder(externalPrefix.length() + 16); buffer.append(internalScheme + ":"); encode(externalPrefix, buffer); return buffer.toString(); } else { return null; } } HashPathIdMapper(String pattern); URI getExternalId(URI internalId); URI getInternalId(URI externalId); String getInternalPrefix(String externalPrefix);  }### Answer:
@Test (expected=NullPointerException.class) public void testGetInternalPrefixNull() { new HashPathIdMapper("").getInternalPrefix(null); }
@Test public void testGetInternalPrefixNoPattern() { assertEquals("file:urn%3Atest", new HashPathIdMapper("").getInternalPrefix("urn:test")); }
@Test public void testGetInternalPrefixWithPattern() { assertNull(new HashPathIdMapper("#").getInternalPrefix("urn:test")); }