This bug is actually in the following code in ArrayList.update():
if (comparator != null
&& binarySearch(this, item, comparator) != index)
throw new IllegalArgumentException("Illegal item modification.");
The issue is that we are updating the existing item with one that will end up in the same place (given the comparator), but since the updated item is not yet in the list, the check above throws the exception.
List: [, [1, 6]]
newItem: [1, 5]