package com.itmill.toolkit.automatedtests.featurebrowser;\r
\r
import java.util.Iterator;\r
+import java.util.LinkedList;\r
+import java.util.List;\r
import java.util.Random;\r
import java.util.Set;\r
\r
// loop each selected and copy to "saved" table\r
final Set selected = (Set) source.getValue();\r
int s = 0;\r
- for (final Iterator it = selected.iterator(); it.hasNext();) {\r
+ \r
+ // The set can return the items in quite any order, but\r
+ // for testing purposes they always have to be in the\r
+ // same order.\r
+ List ordered = new LinkedList(selected);\r
+ java.util.Collections.sort(ordered);\r
+ \r
+ // Now move the items to the other table\r
+ for (final Iterator it = ordered.iterator(); it.hasNext();) {\r
final Object id = it.next();\r
if (!saved.containsId(id)) {\r
final Item item = source.getItem(id);\r