DASpecification { public static List<TNodeTemplate> getNodeTemplatesWithAbstractDAs(TTopologyTemplate topologyTemplate) { List<TNodeTemplate> nodeTemplates = topologyTemplate.getNodeTemplates(); List<TNodeTemplate> nodeTemplatesWithAbstractDA = nodeTemplates.stream() .filter(nt -> nt.getDeploymentArtifacts() != null) .filter(nt -> nt.getDeploymentArtifacts().getDeploymentArtifact().stream() .anyMatch(da -> getArtifactTypeOfDA(da).getAbstract() == TBoolean.YES)) .collect(Collectors.toList()); return nodeTemplatesWithAbstractDA; }  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 getNodeTemplatesWithAbstractDAs() throws Exception { setRevisionTo("af529e513388dc9358a8f700757d8dc59aba3a55"); ServiceTemplateId id = new ServiceTemplateId("http: TTopologyTemplate topologyTemplate = this.repository.getElement(id).getTopologyTemplate(); List<TNodeTemplate> nodeTemplateWithAbstractDA = new ArrayList<>(); nodeTemplateWithAbstractDA.add(topologyTemplate.getNodeTemplate("shetland_pony")); List<TNodeTemplate> nodesWithAbstractDA = DASpecification.getNodeTemplatesWithAbstractDAs(topologyTemplate); assertEquals(nodeTemplateWithAbstractDA, nodesWithAbstractDA); }