test_class.declarator: ontology = TestOntology.ontology()
test_class.modifier: private final
test_class.original_string: private final Ontology ontology = TestOntology.ontology();
test_class.type: Ontology
test_class.var_name: ontology
test_class.declarator: annotations = Lists.newArrayList(
        new TestTermAnnotation(TermId.of("HP:0000001"), TermId.of("TEST","one")),
        new TestTermAnnotation(TermId.of("HP:0000001"), TermId.of("TEST","two")),
        new TestTermAnnotation(TermId.of("HP:0000002"), TermId.of("TEST","one")),
        new TestTermAnnotation(TermId.of("HP:0000002"), TermId.of("TEST","three")))
test_class.modifier: private final
test_class.original_string: private final List<TestTermAnnotation> annotations = Lists.newArrayList(
        new TestTermAnnotation(TermId.of("HP:0000001"), TermId.of("TEST","one")),
        new TestTermAnnotation(TermId.of("HP:0000001"), TermId.of("TEST","two")),
        new TestTermAnnotation(TermId.of("HP:0000002"), TermId.of("TEST","one")),
        new TestTermAnnotation(TermId.of("HP:0000002"), TermId.of("TEST","three")));
test_class.type: List<TestTermAnnotation>
test_class.var_name: annotations
test_class.file: phenol-core/src/test/java/org/monarchinitiative/phenol/ontology/data/TermAnnotationsTest.java
test_class.identifier: TermAnnotationsTest
test_case.body: @Test
    void testConstructTermLabelToAnnotationsMap() {
      Map<TermId, Collection<TermId>> map = TermAnnotations.constructTermLabelToAnnotationsMap(ontology, annotations);
      TermId test1 = TermId.of("TEST:one");
      assertTrue(map.containsKey(test1));
      // there are three annotated items, so we expect 3 keys
      assertEquals(3, map.size());
    }
test_case.class_method_signature: TermAnnotationsTest.testConstructTermLabelToAnnotationsMap()
test_case.full_signature: @Test void testConstructTermLabelToAnnotationsMap()
test_case.identifier: testConstructTermLabelToAnnotationsMap
test_case.invocations: constructTermLabelToAnnotationsMap of assertTrue containsKey assertEquals size
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testConstructTermLabelToAnnotationsMap()
focal_class.file: phenol-core/src/main/java/org/monarchinitiative/phenol/ontology/data/TermAnnotations.java
focal_class.identifier: TermAnnotations
focal_class.class_method_signature: TermAnnotations.TermAnnotations()
focal_class.full_signature: private  TermAnnotations()
focal_class.identifier: TermAnnotations
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  TermAnnotations()
focal_class.class_method_signature: TermAnnotations.constructTermAnnotationToLabelsMap(
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_class.full_signature: public static Map<TermId, Collection<TermId>> constructTermAnnotationToLabelsMap(
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_class.identifier: constructTermAnnotationToLabelsMap
focal_class.modifiers: public static
focal_class.parameters: (
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_class.return: Map<TermId, Collection<TermId>>
focal_class.signature: Map<TermId, Collection<TermId>> constructTermAnnotationToLabelsMap(
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_class.class_method_signature: TermAnnotations.constructTermLabelToAnnotationsMap(
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_class.full_signature: public static Map<TermId, Collection<TermId>> constructTermLabelToAnnotationsMap(
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_class.identifier: constructTermLabelToAnnotationsMap
focal_class.modifiers: public static
focal_class.parameters: (
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_class.return: Map<TermId, Collection<TermId>>
focal_class.signature: Map<TermId, Collection<TermId>> constructTermLabelToAnnotationsMap(
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_method.body: public static Map<TermId, Collection<TermId>> constructTermLabelToAnnotationsMap(
        Ontology ontology, Collection<? extends TermAnnotation> annotations) {
      final Map<TermId, Collection<TermId>> result = new HashMap<>();
  
      for (TermAnnotation anno : annotations) {
        for (TermId termId : ontology.getAncestorTermIds(anno.getTermId(), true)) {
          if (!result.containsKey(anno.getLabel())) {
            result.put(anno.getLabel(), Sets.newHashSet(termId));
          } else {
            result.get(anno.getLabel()).add(termId);
          }
        }
      }
  
      return result;
    }
focal_method.class_method_signature: TermAnnotations.constructTermLabelToAnnotationsMap(
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_method.full_signature: public static Map<TermId, Collection<TermId>> constructTermLabelToAnnotationsMap(
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_method.identifier: constructTermLabelToAnnotationsMap
focal_method.invocations: getAncestorTermIds getTermId containsKey getLabel put getLabel newHashSet add get getLabel
focal_method.modifiers: public static
focal_method.parameters: (
        Ontology ontology, Collection<? extends TermAnnotation> annotations)
focal_method.return: Map<TermId, Collection<TermId>>
focal_method.signature: Map<TermId, Collection<TermId>> constructTermLabelToAnnotationsMap(
        Ontology ontology, Collection<? extends TermAnnotation> annotations)