/**
 * Given a list of elements and a list of newElements, appends only the new elements that are not null
 * to the original list and returns the updated list.
 */
fun appendNewElements(elements: MutableList<Any?>, newElements: List<Any?>): MutableList<Any?> {

    for (newElement in newElements) {
        if (newElement != null) {
            elements.add(newElement)
        }
    }
    return elements
}
/**
 * Given a list of elements and a list of newElements, appends only the new elements that are not null
 * to the original list and returns the updated list.
 */
fun appendNewElements(elements: MutableList<Any?>, newElements: List<Any?>): MutableList<Any?> {
/**
 * Given a list of elements and a list of newElements, appends only the new elements that are not null
 * to the original list and returns the updated list.
 */
fun appendNewElements(elements: MutableList<Any?>, newElements: List<Any?>): MutableList<Any?> {

    for (newElement in newElements) {
        if (newElement != null) {
            elements.add(newElement)
        }
    }
    return elements
}