fix index out of bounds during list comparison in ListUtils