class ImmutableFeatures implements Features {

    @Override
    public Features setFeature(final Feature feature) {
        checkNotNull(feature, "Feature to be set");

        final Feature existingFeature = getFeatureOrNull(feature.getId());
        if (!Objects.equals(existingFeature, feature)) {
            return createNewFeaturesWithNewFeature(feature);
        }
        return this;
    }

    private  ImmutableFeatures(final Map<String, Feature> features);

}