code: public static <V, C extends Collection<Node<V>>> C collectNodes(List<Node<V>> parents,
                                                                      Predicate<Node<V>> predicate,
                                                                      C collection) {
          checkArgNotNull(predicate, "predicate");
          checkArgNotNull(collection, "collection");
          if (parents != null && !parents.isEmpty()) {
              for (Node<V> child : parents) {
                  if (predicate.apply(child)) {
                      collection.add(child);
                  }
                  collectNodes(child, predicate, collection);
              }
          }
          return collection;
      }
docs: Collects all nodes underneath the given parents for which the given predicate evaluates to true.
  
  @param parents    the parent Nodes to look through
  @param predicate  the predicate
  @param collection the collection to collect the found Nodes into
  @return the same collection instance passed as a parameter