Avoid assigment in conditions foreach starts at begin of iterator, the while loop can process the next from within the result, but all the iterator in search are rewinded before iterator starts Change-Id: I38b2729418e8389c681c6cd84858f5e5ed25bd3e