### Question:
DiscoveryClient { public Map<String, MetaData> findInstances() { Map<String, MetaData> instances = new TreeMap<String, MetaData>(); init(); try { for (String path : filters) { logger.debug("checking entries with path filter: " + path); String currentRoot = basePath.endsWith("/") ? basePath.substring(0, basePath.length() - 1) : basePath; String[] segments = path.split("/+"); if (segments.length > 0 && "".equalsIgnoreCase(segments[0])) { segments = Arrays.copyOfRange(segments, 1, segments.length); } processPath(instances, currentRoot, segments); } } catch (Exception e) { throw Throwables.propagate(e); } return instances; } DiscoveryClient(CuratorFramework curatorFramework);  DiscoveryClient(CuratorFramework curatorFramework, String basePath, ServiceDiscoveryManager discoveryManager);  DiscoveryClient(CuratorFramework curatorFramework, String basePath, List<String> filters,
            ServiceDiscoveryManager discoveryManager); DiscoveryClient usingBasePath(String basePath); DiscoveryClient withCriteria(String filter); DiscoveryClient withCriteria(ServiceClassifier prototype); Map<String, MetaData> findInstances();  }### Answer:
@Test public void testFindInstances() { DiscoveryClient client = new TestableDiscoveryClient(null, "/some/slashes/", " @Override protected void processPath(Map<String, MetaData> instances, String currentRoot, String[] segments) { Assert.assertFalse(currentRoot.endsWith("/")); List<String> list = Arrays.asList(segments); Assert.assertFalse(list.contains("")); } }; client.findInstances(); }
@Test public void testFindDirGlob() { DiscoveryClient client = new TestableDiscoveryClient(null, basePath, "/*/zz"); instances = client.findInstances(); Assert.assertEquals(2, instances.size()); }
@Test public void testFindSingleDir() { DiscoveryClient client = new TestableDiscoveryClient(null, basePath, "/b/bb"); instances = client.findInstances(); Assert.assertEquals(2, instances.size()); Assert.assertTrue(instances.containsKey(basePath + "/" + "b/bb/bbb")); }