AllocationUtils { public static List<TPolicyTemplate> getPolicyTemplates(TNodeTemplate nodeTemplate) { List<TPolicyTemplate> policyTemplates = new ArrayList<>(); if (nodeTemplate.getPolicies() != null) { List<TPolicy> tPolicies = nodeTemplate.getPolicies().getPolicy(); for (TPolicy tPolicy : tPolicies) { policyTemplates.add(toPolicyTemplate(tPolicy)); } } return policyTemplates; }  static List<List<T>> getPermutations(List<List<T>> possibilities, int max); static List<TopologyWrapper> generateTargetLabelTopologies(TopologyWrapper topology,
                                                                      List<List<PermutationHelper>> permutations); static List<TPolicyTemplate> getPolicyTemplates(TNodeTemplate nodeTemplate); static TPolicyTemplate toPolicyTemplate(TPolicy policy); static TTopologyTemplate deepcopy(TTopologyTemplate topologyTemplate); static TTopologyTemplate deepcopy(TTopologyTemplate topologyTemplate, boolean changeNames); static TNodeTemplate clone(TNodeTemplate nodeTemplate, boolean changeNames); static TRelationshipTemplate clone(TRelationshipTemplate relationshipTemplate, boolean changeNames); static long idCounter; }
@Test public void getPolicyTemplates() { TNodeTemplate nodeTemplate = topology.getNodeTemplate("shetland_pony_3"); List<TPolicyTemplate> policies = AllocationUtils.getPolicyTemplates(nodeTemplate); assertEquals(1, policies.size()); assertEquals("FloorWarmth10", policies.get(0).getId()); }