If I do that, B items are not updated with A items...
# getting-started
v
If I do that, B items are not updated with A items with same id, B items are updated only with new A items that are not in B
v
Could you explain what you mean by "updated"?
v
Items in A array have attributes with updates values. So I need to replace those items in B array, when they have the same id attribute.
e
.contains()
will check for the equality for all attributes, so you won't match any. You should use
Copy code
A.forEach { a ->
    if (B.any{ it.id == a.id }) {
        val index = B.rows.indexOfFirst { it.id == a.id }
        B[index] = a
    }
}