test_class.file: phenol-core/src/test/java/org/monarchinitiative/phenol/ontology/algo/OntologyTermsTest.java
test_class.identifier: OntologyTermsTest
test_class.superclass: extends VegetableOntologyTestBase
test_case.body: @Test
    void testVisitParentsOf() {
      Set<TermId> parents = new TreeSet<>();
  
      OntologyTerms.visitParentsOf(
        idBlueCarrot,
        ontology,
        (ontology, termId) -> {
          parents.add(termId);
          return true;
        });
  
      assertEquals(
        ImmutableSet.of(
          TermId.of("VO:0000001"),
          TermId.of("VO:0000002"),
          TermId.of("VO:0000004"),
          TermId.of("VO:0000007")),
        parents);
    }
test_case.class_method_signature: OntologyTermsTest.testVisitParentsOf()
test_case.full_signature: @Test void testVisitParentsOf()
test_case.identifier: testVisitParentsOf
test_case.invocations: visitParentsOf add assertEquals of of of of of
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testVisitParentsOf()
focal_class.file: phenol-core/src/main/java/org/monarchinitiative/phenol/ontology/algo/OntologyTerms.java
focal_class.identifier: OntologyTerms
focal_class.class_method_signature: OntologyTerms.visitChildrenOf(
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_class.full_signature: public static void visitChildrenOf(
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_class.identifier: visitChildrenOf
focal_class.modifiers: public static
focal_class.parameters: (
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_class.return: void
focal_class.signature: void visitChildrenOf(
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_class.class_method_signature: OntologyTerms.childrenOf(TermId termId, O ontology)
focal_class.full_signature: public static Set<TermId> childrenOf(TermId termId, O ontology)
focal_class.identifier: childrenOf
focal_class.modifiers: public static
focal_class.parameters: (TermId termId, O ontology)
focal_class.return: Set<TermId>
focal_class.signature: Set<TermId> childrenOf(TermId termId, O ontology)
focal_class.class_method_signature: OntologyTerms.visitParentsOf(
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_class.full_signature: public static void visitParentsOf(
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_class.identifier: visitParentsOf
focal_class.modifiers: public static
focal_class.parameters: (
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_class.return: void
focal_class.signature: void visitParentsOf(
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_class.class_method_signature: OntologyTerms.parentsOf(TermId termId, O ontology)
focal_class.full_signature: public static Set<TermId> parentsOf(TermId termId, O ontology)
focal_class.identifier: parentsOf
focal_class.modifiers: public static
focal_class.parameters: (TermId termId, O ontology)
focal_class.return: Set<TermId>
focal_class.signature: Set<TermId> parentsOf(TermId termId, O ontology)
focal_method.body: public static <O extends Ontology> void visitParentsOf(
      TermId termId, O ontology, TermVisitor<O> termVisitor) {
      // Setup BFS for visiting the termds.
      BreadthFirstSearch<TermId, IdLabeledEdge> bfs = new BreadthFirstSearch<>();
      // TODO: Is there a more elegant solution to this problem?
      DefaultDirectedGraph<TermId, IdLabeledEdge> graph = ontology.getGraph();
  
      // Perform BFS.
      bfs.startFromForward(
          graph,
          termId,
          new VertexVisitor<TermId, IdLabeledEdge>() {
            @Override
            public boolean visit(DefaultDirectedGraph<TermId, IdLabeledEdge> g, TermId v) {
              return termVisitor.visit(ontology, v);
            }
          });
    }
focal_method.class_method_signature: OntologyTerms.visitParentsOf(
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_method.full_signature: public static void visitParentsOf(
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_method.identifier: visitParentsOf
focal_method.invocations: getGraph startFromForward visit
focal_method.modifiers: public static
focal_method.parameters: (
      TermId termId, O ontology, TermVisitor<O> termVisitor)
focal_method.return: void
focal_method.signature: void visitParentsOf(
      TermId termId, O ontology, TermVisitor<O> termVisitor)