class BackendUtils {

    public static TTopologyTemplate clone(TTopologyTemplate topologyTemplate) {
        TTopologyTemplate topologyTemplateClone = new TTopologyTemplate();
        List<TEntityTemplate> entityTemplate = topologyTemplate.getNodeTemplateOrRelationshipTemplate();
        topologyTemplateClone.getNodeTemplateOrRelationshipTemplate().addAll(entityTemplate);
        return topologyTemplateClone;

        //Copy based on http://stackoverflow.com/a/3899882
		/*try {
			JAXBContext sourceJAXBContext = JAXBSupport.context.newInstance(element.getClass());
			JAXBContext targetJAXBContext = JAXBSupport.context.newInstance(element.getClass());
			return (T) targetJAXBContext.createUnmarshaller().unmarshal(new JAXBSource(sourceJAXBContext, element));
		} catch (JAXBException e) {
			logger.error("Cannot clone object", e);
			return null;
		}*/
    }

}