code: private void collectNodes(ContentTypeBean node, Collection<ContentTypeBean> collection) {
  
      collection.add(node);
      for (ContentType child : node.getChildren()) {
        collectNodes((ContentTypeBean) child, collection);
      }
    }
docs: This method walks down the tree of {@link ContentTypeBean}s recursively adding them to the given {@link Collection}
  .
  
  @param node is the current node to traverse.
  @param collection is where to {@link Collection#add(Object) add} the {@link ContentTypeBean} objects.