Splitting { protected List<TNodeTemplate> getHostedOnSuccessorsOfNodeTemplate(TTopologyTemplate topologyTemplate, TNodeTemplate nodeTemplate) { List<TNodeTemplate> successorNodeTemplates = new ArrayList<>(); for (TRelationshipTemplate relationshipTemplate : ModelUtilities.getOutgoingRelationshipTemplates(topologyTemplate, nodeTemplate)) { if (getBasisRelationshipType(relationshipTemplate.getType()).getValidTarget() != null && getBasisRelationshipType(relationshipTemplate.getType()).getValidTarget().getTypeRef().getLocalPart().equalsIgnoreCase("Container")) { successorNodeTemplates.add(ModelUtilities.getTargetNodeTemplateOfRelationshipTemplate(topologyTemplate, relationshipTemplate)); } } return successorNodeTemplates; }  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 testgetSuccessor() throws Exception { TNodeTemplate nt1 = topologyTemplate.getNodeTemplateOrRelationshipTemplate() .stream() .filter(x -> x instanceof TNodeTemplate) .map(TNodeTemplate.class::cast) .filter(nt -> nt.getId().equals("NT1")) .findAny() .get(); TNodeTemplate nt2 = topologyTemplate.getNodeTemplateOrRelationshipTemplate() .stream() .filter(x -> x instanceof TNodeTemplate) .map(TNodeTemplate.class::cast) .filter(nt -> nt.getId().equals("NT1_3")) .findAny() .get(); List<TNodeTemplate> expectedNodes = new ArrayList<>(); expectedNodes.add(nt2); assertEquals(expectedNodes, splitting.getHostedOnSuccessorsOfNodeTemplate(topologyTemplate2, nt1)); }