/**
 * This function takes a dictionary of names and their corresponding ages as input. It changes the name of a Police Officer given the current name and the new name.
 *
 * @param dictionary A dictionary with names as keys and ages as values.
 * @param currentName The current name of the Police Officer.
 * @param newName The new name that should replace the current name.
 * @return The updated dictionary with the Police Officer's name changed.
 */
fun changeOfficerName(dictionary: MutableMap<String, Int>, currentName: String, newName: String): MutableMap<String, Int> {

    if (currentName in dictionary) {
        dictionary[newName] = dictionary.remove(currentName)!!
    }
    return dictionary
}

// Example usage
/**
 * This function takes a dictionary of names and their corresponding ages as input. It changes the name of a Police Officer given the current name and the new name.
 *
 * @param dictionary A dictionary with names as keys and ages as values.
 * @param currentName The current name of the Police Officer.
 * @param newName The new name that should replace the current name.
 * @return The updated dictionary with the Police Officer's name changed.
 */
fun changeOfficerName(dictionary: MutableMap<String, Int>, currentName: String, newName: String): MutableMap<String, Int> {
/**
 * This function takes a dictionary of names and their corresponding ages as input. It changes the name of a Police Officer given the current name and the new name.
 *
 * @param dictionary A dictionary with names as keys and ages as values.
 * @param currentName The current name of the Police Officer.
 * @param newName The new name that should replace the current name.
 * @return The updated dictionary with the Police Officer's name changed.
 */
fun changeOfficerName(dictionary: MutableMap<String, Int>, currentName: String, newName: String): MutableMap<String, Int> {

    if (currentName in dictionary) {
        dictionary[newName] = dictionary.remove(currentName)!!
    }
    return dictionary
}

// Example usage