code: public static <V, C extends Collection<Node<V>>> C collectNodesByPath(List<Node<V>> parents, String path,
                                                                            C collection) {
          checkArgNotNull(path, "path");
          checkArgNotNull(collection, "collection");
          if (parents != null && !parents.isEmpty()) {
              int separatorIndex = path.indexOf('/');
              String prefix = separatorIndex != -1 ? path.substring(0, separatorIndex) : path;
              for (Node<V> child : parents) {
                  if (StringUtils.startsWith(child.getLabel(), prefix)) {
                      if (separatorIndex == -1) {
                          collection.add(child);
                      } else {
                          collectNodesByPath(child, path.substring(separatorIndex + 1), collection);
                      }
                  }
              }
          }
          return collection;
      }
docs: Collects all nodes underneath the given parents that match the given path.
  The path is a '/' separated list of node label prefixes describing the ancestor chain of the node to look for
  relative to the given parent nodes.
  
  @param parents    the parent Nodes to look through
  @param path       the path to the Nodes being searched for
  @param collection the collection to collect the found Nodes into
  @return the same collection instance passed as a parameter