code: private static void getDep(TreeGraphNode t, List<TypedDependency> basicDep,
                               Filter<TypedDependency> f) {
      if (t.isPhrasal()) {          // don't do leaves of POS tags (chris changed this from numChildren > 0 in 2010)
        Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> depMap = getAllDependents(t);
        for (Class<? extends CoreAnnotation> depName : depMap.keySet()) {
          for (TreeGraphNode depNode : depMap.get(depName)) {
            TreeGraphNode gov = t.headWordNode();
            TreeGraphNode dep = depNode.headWordNode();
            if (gov != dep) {
              List<GrammaticalRelation> rels = getListGrammaticalRelation(t, depNode);
              if (!rels.isEmpty()) {
                for (GrammaticalRelation rel : rels) {
                  TypedDependency newDep = new TypedDependency(rel, gov, dep);
                  if (!basicDep.contains(newDep) && f.accept(newDep)) {
                    newDep.setExtra();
                    basicDep.add(newDep);
                  }
                }
              }
            }
          }
        }
        // now recurse into children
        for (Tree kid : t.children()) {
          getDep((TreeGraphNode) kid, basicDep, f);
        }
      }
    }
docs: Look through the tree t and adds to the List basicDep dependencies
  which aren't in it but which satisfy the filter f.
  
  @param t The tree to examine (not changed)
  @param basicDep The list of dependencies which may be augmented
  @param f Additional dependencies are added only if they pass this filter