/**
 * This function takes a set of existing electrical connections and a new connection
 * to be added. It performs an identity comparison to check if the new connection already
 * exists in the set. If not, it adds the new connection to the set and returns it.
 *
 * @param connections Set of existing electrical connections
 * @param newConnection New electrical connection to be added
 * @return Updated set of electrical connections
 */
fun checkElectricalConnections(connections: MutableSet<String>, newConnection: String): MutableSet<String> {

    // Perform identity comparison to check if the new connection is already present
    if (newConnection !in connections) {
        // Add the new connection to the set
        connections.add(newConnection)
    }
    return connections
}
/**
 * This function takes a set of existing electrical connections and a new connection
 * to be added. It performs an identity comparison to check if the new connection already
 * exists in the set. If not, it adds the new connection to the set and returns it.
 *
 * @param connections Set of existing electrical connections
 * @param newConnection New electrical connection to be added
 * @return Updated set of electrical connections
 */
fun checkElectricalConnections(connections: MutableSet<String>, newConnection: String): MutableSet<String> {
/**
 * This function takes a set of existing electrical connections and a new connection
 * to be added. It performs an identity comparison to check if the new connection already
 * exists in the set. If not, it adds the new connection to the set and returns it.
 *
 * @param connections Set of existing electrical connections
 * @param newConnection New electrical connection to be added
 * @return Updated set of electrical connections
 */
fun checkElectricalConnections(connections: MutableSet<String>, newConnection: String): MutableSet<String> {

    // Perform identity comparison to check if the new connection is already present
    if (newConnection !in connections) {
        // Add the new connection to the set
        connections.add(newConnection)
    }
    return connections
}