UriPatternOrderedMatcher implements LookupRegistry<T> { @Override public synchronized T lookup(final String path) { Args.notNull(path, "Request path"); for (final Entry<String, T> entry : this.map.entrySet()) { final String pattern = entry.getKey(); if (path.equals(pattern)) { return entry.getValue(); } if (matchUriRequestPattern(pattern, path)) { return this.map.get(pattern); } } return null; } UriPatternOrderedMatcher(); synchronized Set<Entry<String, T>> entrySet(); @Override synchronized void register(final String pattern, final T obj); @Override synchronized void unregister(final String pattern); @Override synchronized T lookup(final String path); @Override String toString();  }
@Test(expected=NullPointerException.class) public void testLookupInvalidInput() throws Exception { final LookupRegistry<Object> matcher = new UriPatternOrderedMatcher<>(); matcher.lookup(null); }