DASpecification { public static Map<TRelationshipTemplate, TNodeTemplate> getNodesWithSuitableConcreteDAAndTheDirectlyConnectedNode (TNodeTemplate nodeTemplate, TDeploymentArtifact deploymentArtifact, TTopologyTemplate topologyTemplate) { Map<TRelationshipTemplate, TNodeTemplate> nodeTemplateWithConcreteDAAndDirectlyConnectedNode = new HashMap<>(); List<TRelationshipTemplate> outgoingRelationshipTemplates = ModelUtilities.getOutgoingRelationshipTemplates(topologyTemplate, nodeTemplate); for (TRelationshipTemplate outgoingRelationship : outgoingRelationshipTemplates) { TNodeTemplate targetNodeTemplate = ModelUtilities.getTargetNodeTemplateOfRelationshipTemplate(topologyTemplate, outgoingRelationship); TNodeTemplate nodesWithSuitableDA = getNodesWithSuitableConcreteDAs(targetNodeTemplate, deploymentArtifact, topologyTemplate); if (nodesWithSuitableDA != null) { nodeTemplateWithConcreteDAAndDirectlyConnectedNode.put(outgoingRelationship, nodesWithSuitableDA); } } return nodeTemplateWithConcreteDAAndDirectlyConnectedNode; }  static List<TNodeTemplate> getNodeTemplatesWithAbstractDAs(TTopologyTemplate topologyTemplate); static TArtifactType getArtifactTypeOfDA(TDeploymentArtifact deploymentArtifact); static List<TArtifactType> getArtifactTypeHierarchy(TArtifactType artifactType); static Map<TRelationshipTemplate, TNodeTemplate> getNodesWithSuitableConcreteDAAndTheDirectlyConnectedNode(TNodeTemplate nodeTemplate, TDeploymentArtifact deploymentArtifact, TTopologyTemplate topologyTemplate); static TNodeTemplate getNodesWithSuitableConcreteDAs(TNodeTemplate nodeTemplate, TDeploymentArtifact deploymentArtifact, TTopologyTemplate topologyTemplate); static TDeploymentArtifact getSuitableConcreteDA(TDeploymentArtifact abstractDeploymentArtifact, TNodeTemplate nodeTemplate);  }
@Test public void getNodesWithSuitableConcreteDAAndTheDirectlyConnectedNode() throws Exception { setRevisionTo("5f63267261584a513dd8a9b7960687cc3dda910a"); ServiceTemplateId id = new ServiceTemplateId("http: TTopologyTemplate topologyTemplate = this.repository.getElement(id).getTopologyTemplate(); TNodeTemplate nodeTemplateWithAbstractDA = topologyTemplate.getNodeTemplate("shetland_pony"); TDeploymentArtifact deploymentArtifact = nodeTemplateWithAbstractDA.getDeploymentArtifacts().getDeploymentArtifact().get(0); TNodeTemplate nodeTemplateConcretDA1 = topologyTemplate.getNodeTemplate("dressageequipment"); TRelationshipTemplate relationshipTemplate1 = topologyTemplate.getRelationshipTemplate("con_42"); TNodeTemplate nodeTemplateConcretDA2 = topologyTemplate.getNodeTemplate("westernequipment"); TRelationshipTemplate relationshipTemplate2 = topologyTemplate.getRelationshipTemplate("con_54"); Map<TRelationshipTemplate, TNodeTemplate> concreteDAsAndConnectedNodes = new HashMap<>(); concreteDAsAndConnectedNodes.put(relationshipTemplate1, nodeTemplateConcretDA1); concreteDAsAndConnectedNodes.put(relationshipTemplate2, nodeTemplateConcretDA2); Map<TRelationshipTemplate, TNodeTemplate> actualNodeWithConcreteDA = DASpecification.getNodesWithSuitableConcreteDAAndTheDirectlyConnectedNode(nodeTemplateWithAbstractDA, deploymentArtifact, topologyTemplate); assertEquals(concreteDAsAndConnectedNodes, actualNodeWithConcreteDA); }