class TopologyTemplateResource {

    @PUT
    @Path("availablefeatures")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public TTopologyTemplate applyAvailableFeatures(ArrayList<AvailableFeaturesApiData> featuresList) {
        Map<String, Map<QName, String>> featureMap = new HashMap<>();

        featuresList.forEach(availableFeaturesApiData -> {
            HashMap<QName, String> featureTypesMap = new HashMap<>();
            if (Objects.nonNull(availableFeaturesApiData.getFeatures())
                && availableFeaturesApiData.getFeatures().size() > 0) {
                availableFeaturesApiData.getFeatures()
                    .forEach(features -> featureTypesMap.put(features.getType(), features.getFeatureName()));
                featureMap.put(availableFeaturesApiData.getNodeTemplateId(), featureTypesMap);
            }
        });

        TTopologyTemplate enrichedTopology = EnhancementUtils.applyFeaturesForTopology(this.topologyTemplate, featureMap);
        this.parent.setTopology(enrichedTopology, this.type);
        RestUtils.persist(this.parent);

        return enrichedTopology;
    }

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

}