Updating test cases to not relay on ordering of getindices any more.

(cherry picked from commit c47c9a2ced0dcd935f408b0a8e002ee0d085e424)