TreeDispatcher implements Dispatcher<E> { public void setDelimiter(String delimiter) { this.delimiter = Pattern.compile(delimiter); }  void setDelimiter(String delimiter); @Override void addEndpoint(String path, E endpoint); @Override E removeEndpoint(String path); @Override E findExactMatch(String path); @Override List<E> findPrefixMatches(String path);  }
@Test public void testSetDelimiter() { TreeDispatcher<String> dispatcher = setupDispatcher(); dispatcher.setDelimiter("\\\\"); assertEquals(dispatcher.findExactMatch("\\one\\two"), "/one/two"); assertNull(dispatcher.findExactMatch("/one/two")); }