class TopologyTemplateResource {

    @GET
    @Path("newversions")
    @Produces(MediaType.APPLICATION_JSON)
    public List<NewVersionListElement> getNewVersionList() {
        IRepository repository = RepositoryFactory.getRepository();

        Map<QName, TNodeType> nodeTypes = repository.getQNameToElementMapping(NodeTypeId.class);
        Map<QName, List<WineryVersion>> versionElements = new HashMap<>();

        for (TNodeTemplate node : this.topologyTemplate.getNodeTemplates()) {
            if (nodeTypes.containsKey(node.getType())) {
                NodeTypeId nodeTypeId = new NodeTypeId(node.getType());
                if (!versionElements.containsKey(nodeTypeId.getQName())) {
                    List<WineryVersion> versionList = BackendUtils.getAllVersionsOfOneDefinition(nodeTypeId).stream()
                        .filter(wineryVersion -> {
                            QName qName = VersionUtils.getDefinitionInTheGivenVersion(nodeTypeId, wineryVersion).getQName();
                            NamespaceProperties namespaceProperties = repository.getNamespaceManager().getNamespaceProperties(qName.getNamespaceURI());
                            return !(namespaceProperties.isGeneratedNamespace()
                                || ModelUtilities.isFeatureType(qName, nodeTypes));
                        })
                        .collect(Collectors.toList());

                    versionElements.put(nodeTypeId.getQName(), versionList);
                }
            }
        }

        return versionElements.entrySet().stream()
            .map(qNameListEntry -> new NewVersionListElement(qNameListEntry.getKey(), qNameListEntry.getValue()))
            .collect(Collectors.toList());
    }

    public  TopologyTemplateResource(AbstractComponentInstanceResourceContainingATopology parent, TTopologyTemplate topologyTemplate, String type);

}