class DASpecification {

    public static TNodeTemplate getNodesWithSuitableConcreteDAs(TNodeTemplate nodeTemplate, TDeploymentArtifact deploymentArtifact, TTopologyTemplate topologyTemplate) {
        // Checks the attached DAs to the node template and compare them with the abstract Type of the D
        if (getSuitableConcreteDA(deploymentArtifact, nodeTemplate) == null) {
            //A concrete DA can only be found in the hostedOn stack
            List<TRelationshipTemplate> outgoingRelationshipTemplates = ModelUtilities.getOutgoingRelationshipTemplates(topologyTemplate, nodeTemplate)
                .stream().filter(outrel -> getBasisRelationshipType(outrel.getType()).getValidTarget().getTypeRef().getLocalPart().equalsIgnoreCase("Container"))
                .collect(Collectors.toList());

            for (TRelationshipTemplate relationshipTemplate : outgoingRelationshipTemplates) {
                TNodeTemplate targetNodeTemplate = ModelUtilities.getTargetNodeTemplateOfRelationshipTemplate(topologyTemplate, relationshipTemplate);
                return getNodesWithSuitableConcreteDAs(targetNodeTemplate, deploymentArtifact, topologyTemplate);
            }

        } else {
            return nodeTemplate;
        }
        return null;
    }

}