UriRegexMatcher implements LookupRegistry<T> { @Override public synchronized void register(final String regex, final T obj) { Args.notNull(regex, "URI request regex"); this.objectMap.put(regex, obj); this.patternMap.put(regex, Pattern.compile(regex)); } UriRegexMatcher(); @Override synchronized void register(final String regex, final T obj); @Override synchronized void unregister(final String regex); @Override synchronized T lookup(final String path); @Override String toString();  }
@Test(expected = NullPointerException.class) public void testRegisterNull() throws Exception { final LookupRegistry<Object> matcher = new UriRegexMatcher<>(); matcher.register(null, null); }
@Test(expected = NullPointerException.class) public void testRegisterInvalidInput() throws Exception { final LookupRegistry<Object> matcher = new UriRegexMatcher<>(); matcher.register(null, null); }