commit db4096d21779ab8e01357dd94437ec904d0b75f3
Author: Patric Plitzner <p.plitzner@bgbm.org>
Date:   Mon Nov 4 13:34:15 2013 +0000

     - changed indention marker #3736
     - enriched test

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
index ee7db7b29..7dcf587ef 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
@@ -970,7 +970,7 @@ public abstract class AbstractUtility {
         for(TermNode<T> node:children){
             String indentString = "";
             for(int i=0;i<depth;i++){
-                indentString += "  ";
+                indentString += "- ";
             }
             result.put(node.term, indentString + node.term.getMessage());
             parseTermTree(node.children, result, depth);
diff --git a/eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/utility/AbstractUtilityTest.java b/eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/utility/AbstractUtilityTest.java
index 2391f91e4..45c87f4b7 100644
--- a/eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/utility/AbstractUtilityTest.java
+++ b/eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/utility/AbstractUtilityTest.java
@@ -10,9 +10,12 @@
 package eu.etaxonomy.taxeditor.store.utility;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.LinkedHashMap;
 
 import org.junit.Test;
@@ -39,27 +42,36 @@ public class AbstractUtilityTest {
         LinkedHashMap<? extends IEnumTerm<?>, String> orderedTerms;
 
         orderedTerms = AbstractUtility.orderTerms(Arrays.asList(SpecimenOrObservationType.values()));
-        checkSize(orderedTerms, Arrays.asList(SpecimenOrObservationType.values()));
+        check(orderedTerms, Arrays.asList(SpecimenOrObservationType.values()));
         orderedTerms = AbstractUtility.orderTerms(Arrays.asList(NomenclaturalCode.values()));
-        checkSize(orderedTerms, Arrays.asList(NomenclaturalCode.values()));
+        check(orderedTerms, Arrays.asList(NomenclaturalCode.values()));
         orderedTerms = AbstractUtility.orderTerms(Arrays.asList(OriginalSourceType.values()));
-        checkSize(orderedTerms, Arrays.asList(OriginalSourceType.values()));
+        check(orderedTerms, Arrays.asList(OriginalSourceType.values()));
         orderedTerms = AbstractUtility.orderTerms(Arrays.asList(PreferencePredicate.values()));
-        checkSize(orderedTerms, Arrays.asList(PreferencePredicate.values()));
+        check(orderedTerms, Arrays.asList(PreferencePredicate.values()));
         orderedTerms = AbstractUtility.orderTerms(Arrays.asList(RankClass.values()));
-        checkSize(orderedTerms, Arrays.asList(RankClass.values()));
+        check(orderedTerms, Arrays.asList(RankClass.values()));
         orderedTerms = AbstractUtility.orderTerms(Arrays.asList(ReferenceType.values()));
-        checkSize(orderedTerms, Arrays.asList(ReferenceType.values()));
+        check(orderedTerms, Arrays.asList(ReferenceType.values()));
         orderedTerms = AbstractUtility.orderTerms(Arrays.asList(TermType.values()));
-        checkSize(orderedTerms, Arrays.asList(TermType.values()));
+        check(orderedTerms, Arrays.asList(TermType.values()));
     }
 
     /**
      * @param orderedTerms
      * @param expectedTerms
      */
-    private void checkSize(LinkedHashMap<? extends IEnumTerm<?>, String> orderedTerms, Collection<? extends IEnumTerm<?>> expectedTerms) {
+    private void check(LinkedHashMap<? extends IEnumTerm<?>, String> orderedTerms, Collection<? extends IEnumTerm<?>> expectedTerms) {
+        assertFalse("Ordered term list is empty!", orderedTerms.isEmpty());
         assertEquals("Some terms got lost while ordering.", expectedTerms.size(), orderedTerms.size());
+        Iterator<String> itti = orderedTerms.values().iterator();
+        String first = itti.next();
+        while (itti.hasNext()) {
+            String next = itti.next();
+            if(next.startsWith(" -")){
+                assertTrue("Sorting is not alphabetically correct.", first.compareTo(next)<0);
+            }
+        }
     }
 
 }
