private void collectMatching(ZooKeeper zkClient, String basePath, List<String> result) throws KeeperException, InterruptedException {
    for (String child : zkClient.getChildren(basePath, null)) {
      if (first().matches(child)) {
        if (rest() == null) {
          result.add(append(basePath, child));
        } else {
          rest().collectMatching(zkClient, append(basePath, child), result);
        }
      }
    }
  }
Finds matching paths from the given base node
E.g.:
 If the pattern is /*&#47;/abc* it will find nodes like:
   /a/abcdef
   /xy/abc/efg
   /def/abc
ambari-agent/src/main/java/org/apache/ambari/tools/zk/ZkPathPattern.java