GroupsIT: separate order check from element check

The caller of assertIncludes only cares that the set of includes is the
same. Additionally, assertIncludes itself cares that the output of this
particular extension API is sorted. But we can check this within the
body of assertIncludes without requiring callers to manually sort their
arguments.

The previous approach had the pitfall that "group-9" sorts after
"group-10", meaning that addMultipleIncludes might be making an
incorrect assumption that g1's name sorts before g2's name, depending on
the exact subset of test methods that get run.

Change-Id: Ic4378ba919c03061e0d46b9e8715dec2920478d5
diff --git a/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java b/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java
index db96ac1..ee22141 100644
--- a/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java
@@ -1512,9 +1512,9 @@
   }
 
   private static void assertIncludes(Iterable<GroupInfo> includes, String... expectedNames) {
-    assertThat(Iterables.transform(includes, i -> i.name))
-        .containsExactlyElementsIn(Arrays.asList(expectedNames))
-        .inOrder();
+    Iterable<String> names = Iterables.transform(includes, i -> i.name);
+    assertThat(names).containsExactlyElementsIn(Arrays.asList(expectedNames));
+    assertThat(names).isOrdered();
   }
 
   private void assertNoIncludes(String group) throws Exception {