class AzurePlatformParameters implements PlatformParameters {

    @Override
    public Map<String, InstanceGroupParameterResponse> collectInstanceGroupParameters(Set<InstanceGroupParameterRequest> instanceGroupParameterRequests) {
        Map<String, InstanceGroupParameterResponse> result = new HashMap<>();
        for (InstanceGroupParameterRequest groupParameterRequest : instanceGroupParameterRequests) {
            InstanceGroupParameterResponse instanceGroupParameterResponse = new InstanceGroupParameterResponse();
            if (groupParameterRequest.getParameters().containsKey("availabilitySet")) {
                instanceGroupParameterResponse.setGroupName(groupParameterRequest.getGroupName());
                instanceGroupParameterResponse.setParameters(groupParameterRequest.getParameters());

            } else {
                Map<String, Object> parameters = groupParameterRequest.getParameters();

                Map<String, Object> availabilitySet = new HashMap<>();
                availabilitySet.put("name", String.format("%s-%s-as", groupParameterRequest.getStackName(), groupParameterRequest.getGroupName()));
                availabilitySet.put("faultDomainCount", DEFAULT_FAULT_DOMAIN_COUNTER);
                availabilitySet.put("updateDomainCount", DEFAULT_UPDATE_DOMAIN_COUNTER);

                parameters.put("availabilitySet", availabilitySet);

                instanceGroupParameterResponse.setGroupName(groupParameterRequest.getGroupName());
                instanceGroupParameterResponse.setParameters(parameters);
            }
            result.put(instanceGroupParameterResponse.getGroupName(), instanceGroupParameterResponse);
        }
        return result;
    }

}