                                    defaultConfigurationName: self.defaultConfigurationName)
     }
     
+    /// Returns a new configuration list removing a configuration.
+    ///
+    /// - Parameter configuration: reference to the configuration to be removed.
+    /// - Returns: new configuration list with the configuration removed.
     public func removing(configuration: UUID) -> XCConfigurationList {
         var buildConfigurations = self.buildConfigurations
-        if let index = buildConfigurations.index(of: configuration) {
-            buildConfigurations.remove(at: index)
-        }
+        buildConfigurations.remove(configuration)
         return XCConfigurationList(reference: self.reference,
                                    buildConfigurations: buildConfigurations,
                                    defaultConfigurationName: self.defaultConfigurationName)

import Foundation

// This is the element for listing build configurations.
public struct XCConfigurationList: Isa {
    
    // MARK: - Attributes
    
    public let reference: UUID
    
    public let isa: String = "XCConfigurationList"
    
    public let buildConfigurations: Set<UUID>
    
    public let defaultConfigurationIsVisible: Int = 0
    
    public let defaultConfigurationName: String
    
    // MARK: - Init
    
    public init(reference: UUID,
                buildConfigurations: Set<UUID>,
                defaultConfigurationName: String) {
        self.reference = reference
        self.buildConfigurations = buildConfigurations
        self.defaultConfigurationName = defaultConfigurationName
    }
    
    // MARK: - Public
    
    public func adding(configuration: UUID) -> XCConfigurationList {
        var buildConfigurations = self.buildConfigurations
        buildConfigurations.update(with: configuration)

                                   defaultConfigurationName: name)
    }
    
    // MARK: - Hashable
    
    public static func == (lhs: XCConfigurationList,
                           rhs: XCConfigurationList) -> Bool {
        return lhs.reference == rhs.reference &&
        lhs.isa == rhs.isa &&
        lhs.buildConfigurations == rhs.buildConfigurations &&
        lhs.defaultConfigurationIsVisible == rhs.defaultConfigurationIsVisible
    }
    
    public var hashValue: Int { return self.reference.hashValue }

}
