AllocationUtils { public static TNodeTemplate clone(TNodeTemplate nodeTemplate, boolean changeNames) { TNodeTemplate cloned = BackendUtils.clone(nodeTemplate); if (changeNames) { cloned.setName(cloned.getId() + idCounter++); } return cloned; }  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 cloneNotEqualsNT() { TNodeTemplate original = topology.getNodeTemplate("shetland_pony"); original.setMinInstances(1); original.setMaxInstances("1"); TNodeTemplate clone = BackendUtils.clone(original); assertEquals(original, clone); TNodeTemplate cloneNotEquals = AllocationUtils.clone(original, true); assertNotEquals(original, cloneNotEquals); }
@Test public void cloneNotEqualsRT() { TRelationshipTemplate original = topology.getRelationshipTemplates().get(0); TRelationshipTemplate clone = BackendUtils.clone(original); assertEquals(original, clone); TRelationshipTemplate cloneNotEquals = AllocationUtils.clone(original, true); assertNotEquals(original, cloneNotEquals); }