private static <L> int toConstituentCollectionHelper(Tree<L> tree, int start, List<Constituent<L>> constituents) {
    if (tree.isLeaf() || tree.isPreTerminal())
      return 1;
    int span = 0;
    for (Tree<L> child : tree.getChildren()) {
      span += toConstituentCollectionHelper(child, start+span, constituents);
    }
    constituents.add(new Constituent<L>(tree.getLabel(), start, start+span));
    return span;
  }