Splitting { protected List<TNodeTemplate> getNodeTemplatesWithoutIncomingHostedOnRelationships(TTopologyTemplate topologyTemplate) { return ModelUtilities.getAllNodeTemplates(topologyTemplate) .stream() .filter(nt -> getHostedOnPredecessorsOfNodeTemplate(topologyTemplate, nt).isEmpty()) .collect(Collectors.toList()); }  ServiceTemplateId splitTopologyOfServiceTemplate(ServiceTemplateId id); ServiceTemplateId matchTopologyOfServiceTemplate(ServiceTemplateId id); ServiceTemplateId composeServiceTemplates(String composedSolutionServiceTemplateID, List<ServiceTemplateId> serviceTemplateIds); void resolveTopologyTemplate(ServiceTemplateId serviceTemplateId); boolean checkValidTopology(TTopologyTemplate topologyTemplate); TTopologyTemplate split(TTopologyTemplate topologyTemplate); Map<String, List<TTopologyTemplate>> getHostingInjectionOptions(TTopologyTemplate topologyTemplate); Map<String, List<TTopologyTemplate>> getHostingMatchingOptionsWithDefaultLabeling(TTopologyTemplate topologyTemplate); TTopologyTemplate hostMatchingWithDefaultHostSelection(TTopologyTemplate topologyTemplate); TTopologyTemplate connectionMatchingWithDefaultConnectorSelection(TTopologyTemplate topologyTemplate); TTopologyTemplate injectNodeTemplates(TTopologyTemplate topologyTemplate, Map<String, TTopologyTemplate> injectNodes, InjectRemoval removal); Map<String, List<TTopologyTemplate>> getConnectionInjectionOptions(TTopologyTemplate topologyTemplate); TTopologyTemplate injectConnectionNodeTemplates(TTopologyTemplate topologyTemplate, Map<String, TTopologyTemplate> selectedConnectionFragments); Map<TNodeTemplate, Set<TNodeTemplate>> computeTransitiveClosure(TTopologyTemplate topologyTemplate); Map<TRequirement, String> getOpenRequirementsAndMatchingBasisCapabilityTypeNames(TTopologyTemplate topologyTemplate); List<TRequirement> getOpenRequirements(TTopologyTemplate topologyTemplate); TRelationshipType getBasisRelationshipType(QName relationshipTypeQName);  }
@Test public void st1HasTwoNodeTemplatesWithoutIncomingHostedOnRelationshipTemplate() throws Exception { List<String> expectedIds = Arrays.asList("NT1", "NT1_2"); List<TNodeTemplate> expectedNodeTemplates = topologyTemplate.getNodeTemplateOrRelationshipTemplate().stream() .filter(x -> x instanceof TNodeTemplate) .map(TNodeTemplate.class::cast) .filter(nt -> expectedIds.contains(nt.getId())) .collect(Collectors.toList()); List<TNodeTemplate> nodeTemplatesWithoutIncomingEdges = splitting.getNodeTemplatesWithoutIncomingHostedOnRelationships(topologyTemplate); assertEquals(expectedNodeTemplates, nodeTemplatesWithoutIncomingEdges); }