test_class.declarator: GRANDFATHER = "grandfather"
test_class.modifier: private final static
test_class.original_string: private final static String GRANDFATHER = "grandfather";
test_class.type: String
test_class.var_name: GRANDFATHER
test_class.declarator: PARENT = "parent"
test_class.modifier: private final static
test_class.original_string: private final static String PARENT = "parent";
test_class.type: String
test_class.var_name: PARENT
test_class.declarator: MOTHER = "mother"
test_class.modifier: private final static
test_class.original_string: private final static String MOTHER = "mother";
test_class.type: String
test_class.var_name: MOTHER
test_class.declarator: AUNT = "aunt"
test_class.modifier: private final static
test_class.original_string: private final static String AUNT = "aunt";
test_class.type: String
test_class.var_name: AUNT
test_class.declarator: CHILD = "child"
test_class.modifier: private final static
test_class.original_string: private final static String CHILD = "child";
test_class.type: String
test_class.var_name: CHILD
test_class.declarator: GRANDCHILD = "grandchild"
test_class.modifier: private final static
test_class.original_string: private final static String GRANDCHILD = "grandchild";
test_class.type: String
test_class.var_name: GRANDCHILD
test_class.declarator: STRANGER = "stranger"
test_class.modifier: private final static
test_class.original_string: private final static String STRANGER = "stranger";
test_class.type: String
test_class.var_name: STRANGER
test_class.declarator: nodeTypes
test_class.modifier: private static
test_class.original_string: private static Map<QName, TNodeType> nodeTypes;
test_class.type: Map<QName, TNodeType>
test_class.var_name: nodeTypes
test_class.declarator: grandFather = new QName("https://example.org/tosca/substiution", GRANDFATHER)
test_class.modifier: private static
test_class.original_string: private static QName grandFather = new QName("https://example.org/tosca/substiution", GRANDFATHER);
test_class.type: QName
test_class.var_name: grandFather
test_class.declarator: parent = new QName("https://example.org/tosca/substiution", PARENT)
test_class.modifier: private static
test_class.original_string: private static QName parent = new QName("https://example.org/tosca/substiution", PARENT);
test_class.type: QName
test_class.var_name: parent
test_class.declarator: child = new QName("https://example.org/tosca/substiution", CHILD)
test_class.modifier: private static
test_class.original_string: private static QName child = new QName("https://example.org/tosca/substiution", CHILD);
test_class.type: QName
test_class.var_name: child
test_class.declarator: grandChild = new QName("https://example.org/tosca/substiution", GRANDCHILD)
test_class.modifier: private static
test_class.original_string: private static QName grandChild = new QName("https://example.org/tosca/substiution", GRANDCHILD);
test_class.type: QName
test_class.var_name: grandChild
test_class.declarator: mother = new QName("https://example.org/tosca/substiution", MOTHER)
test_class.modifier: private static
test_class.original_string: private static QName mother = new QName("https://example.org/tosca/substiution", MOTHER);
test_class.type: QName
test_class.var_name: mother
test_class.declarator: aunt = new QName("https://my.example.org/tosca/substiution", AUNT)
test_class.modifier: private static
test_class.original_string: private static QName aunt = new QName("https://my.example.org/tosca/substiution", AUNT);
test_class.type: QName
test_class.var_name: aunt
test_class.declarator: stranger = new QName("ftp://example.org/stranger", STRANGER)
test_class.modifier: private static
test_class.original_string: private static QName stranger = new QName("ftp://example.org/stranger", STRANGER);
test_class.type: QName
test_class.var_name: stranger
test_class.file: org.eclipse.winery.model.adaptation/src/test/java/org/eclipse/winery/model/adaptation/substitution/SubstitutionUtilsTest.java
test_class.identifier: SubstitutionUtilsTest
test_case.body: @Test
      public void retrieveTypeHierarchy2() {
          Optional<List<Subtypes<TNodeType>>> tNodeTypeSubtypes = SubstitutionUtils.collectTypeHierarchy(nodeTypes, parent);
  
          assertTrue(tNodeTypeSubtypes.isPresent());
  
          List<Subtypes<TNodeType>> subtypes = tNodeTypeSubtypes.get();
          assertEquals(1, subtypes.size());
  
          Subtypes<TNodeType> firstChild = subtypes.get(0);
          assertEquals(CHILD, firstChild.getElement().getName());
          assertEquals(1, firstChild.getChildren().size());
  
          Subtypes<TNodeType> childOfFirstChild = firstChild.getChildren().get(0);
          assertEquals(GRANDCHILD, childOfFirstChild.getElement().getName());
          assertNull(childOfFirstChild.getChildren());
      }
test_case.class_method_signature: SubstitutionUtilsTest.retrieveTypeHierarchy2()
test_case.full_signature: @Test public void retrieveTypeHierarchy2()
test_case.identifier: retrieveTypeHierarchy2
test_case.invocations: collectTypeHierarchy assertTrue isPresent get assertEquals size get assertEquals getName getElement assertEquals size getChildren get getChildren assertEquals getName getElement assertNull getChildren
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void retrieveTypeHierarchy2()
focal_class.file: org.eclipse.winery.model.adaptation/src/main/java/org/eclipse/winery/model/adaptation/substitution/SubstitutionUtils.java
focal_class.identifier: SubstitutionUtils
focal_class.class_method_signature: SubstitutionUtils.collectSubstitutableTemplates(List<R> templates, Map<QName, T> types)
focal_class.full_signature: public static Map<R, List<Subtypes<T>>> collectSubstitutableTemplates(List<R> templates, Map<QName, T> types)
focal_class.identifier: collectSubstitutableTemplates
focal_class.modifiers: public static
focal_class.parameters: (List<R> templates, Map<QName, T> types)
focal_class.return: Map<R, List<Subtypes<T>>>
focal_class.signature: Map<R, List<Subtypes<T>>> collectSubstitutableTemplates(List<R> templates, Map<QName, T> types)
focal_class.class_method_signature: SubstitutionUtils.collectTypeHierarchy(Map<QName, T> types, QName parent)
focal_class.full_signature: public static Optional<List<Subtypes<T>>> collectTypeHierarchy(Map<QName, T> types, QName parent)
focal_class.identifier: collectTypeHierarchy
focal_class.modifiers: public static
focal_class.parameters: (Map<QName, T> types, QName parent)
focal_class.return: Optional<List<Subtypes<T>>>
focal_class.signature: Optional<List<Subtypes<T>>> collectTypeHierarchy(Map<QName, T> types, QName parent)
focal_class.class_method_signature: SubstitutionUtils.containsPatterns(List<TNodeTemplate> topologyNodes, Map<QName, TNodeType> nodeTypes)
focal_class.full_signature: public static boolean containsPatterns(List<TNodeTemplate> topologyNodes, Map<QName, TNodeType> nodeTypes)
focal_class.identifier: containsPatterns
focal_class.modifiers: public static
focal_class.parameters: (List<TNodeTemplate> topologyNodes, Map<QName, TNodeType> nodeTypes)
focal_class.return: boolean
focal_class.signature: boolean containsPatterns(List<TNodeTemplate> topologyNodes, Map<QName, TNodeType> nodeTypes)
focal_method.body: public static <T extends HasInheritance> Optional<List<Subtypes<T>>> collectTypeHierarchy(Map<QName, T> types, QName parent) {
          T type = types.get(parent);
  
          if (Objects.nonNull(type) && type.getAbstract().equals(TBoolean.YES)) {
              List<Subtypes<T>> subtypes = new ArrayList<>();
              types.forEach((key, current) -> {
                  if (Objects.nonNull(current.getDerivedFrom()) && current.getDerivedFrom().getTypeAsQName().equals(parent)) {
                      Subtypes<T> child = new Subtypes<>(current);
                      subtypes.add(child);
                      collectTypeHierarchy(types, key)
                          .ifPresent(child::addChildren);
                  }
              });
              return Optional.of(subtypes);
          }
  
          return Optional.empty();
      }
focal_method.class_method_signature: SubstitutionUtils.collectTypeHierarchy(Map<QName, T> types, QName parent)
focal_method.full_signature: public static Optional<List<Subtypes<T>>> collectTypeHierarchy(Map<QName, T> types, QName parent)
focal_method.identifier: collectTypeHierarchy
focal_method.invocations: get nonNull equals getAbstract forEach nonNull getDerivedFrom equals getTypeAsQName getDerivedFrom add ifPresent collectTypeHierarchy of empty
focal_method.modifiers: public static
focal_method.parameters: (Map<QName, T> types, QName parent)
focal_method.return: Optional<List<Subtypes<T>>>
focal_method.signature: Optional<List<Subtypes<T>>> collectTypeHierarchy(Map<QName, T> types, QName parent)