/**
 * Return the first key from the keyList that exists in the given dictionary, and if found, break out of the loop.
 *
 * @param dictionary A dictionary to access items from.
 * @param keyList A list of keys to try accessing from the dictionary.
 * @return The found key, or null if no key from the list exists in the dictionary.
 */
fun accessAndBreak(dictionary: Map<String, Any>, keyList: List<String>): String? {

    var foundKey: String? = null
    for (key in keyList) {
        try {
            val value = dictionary.getValue(key)
            foundKey = key
            break
        } catch (e: NoSuchElementException) {
            // Key not found in dictionary
        }
    }
    return foundKey
}
/**
 * Return the first key from the keyList that exists in the given dictionary, and if found, break out of the loop.
 *
 * @param dictionary A dictionary to access items from.
 * @param keyList A list of keys to try accessing from the dictionary.
 * @return The found key, or null if no key from the list exists in the dictionary.
 */
fun accessAndBreak(dictionary: Map<String, Any>, keyList: List<String>): String? {
/**
 * Return the first key from the keyList that exists in the given dictionary, and if found, break out of the loop.
 *
 * @param dictionary A dictionary to access items from.
 * @param keyList A list of keys to try accessing from the dictionary.
 * @return The found key, or null if no key from the list exists in the dictionary.
 */
fun accessAndBreak(dictionary: Map<String, Any>, keyList: List<String>): String? {

    var foundKey: String? = null
    for (key in keyList) {
        try {
            val value = dictionary.getValue(key)
            foundKey = key
            break
        } catch (e: NoSuchElementException) {
            // Key not found in dictionary
        }
    }
    return foundKey
}