Description: Fix a test failure with Java 8
Origin: backport, https://svn.apache.org/r1367129
Bug-Debian: http://bugs.debian.org/760927
--- a/solr/core/src/test/org/apache/solr/handler/component/DummyCustomParamSpellChecker.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DummyCustomParamSpellChecker.java
@@ -9,9 +9,11 @@
 import org.apache.solr.spelling.SpellingResult;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.List;
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -56,12 +58,20 @@
 
     SpellingResult result = new SpellingResult();
     //just spit back out the results
+
+    // sort the keys to make ordering predictable
     Iterator<String> iterator = options.customParams.getParameterNamesIterator();
+    List<String> lst = new ArrayList<String>();
+    while (iterator.hasNext()) {
+      lst.add(iterator.next());
+    }
+    Collections.sort(lst);
+
     int i = 0;
-    while (iterator.hasNext()){
-      String name = iterator.next();
+    for (String name : lst) {
       String value = options.customParams.get(name);
-      result.add(new Token(name, i++, i++),  Collections.singletonList(value));
+      result.add(new Token(name, i, i+1),  Collections.singletonList(value));
+      i += 2;
     }    
     return result;
   }
