package org.rmatil.sync.core;

import java.util.Comparator;

/**
 * Compares two strings by their length.
 */
public class StringLengthComparator implements Comparator<String> {

    /**
     * Compares the strings by their length.
     * <br>
     * <br>
     * {@inheritDoc}
     */
    @Override
    public int compare(String o1, String o2) {
        if (o1.length() < o2.length()) {
            return - 1;
        }

        if (o1.length() > o2.length()) {
            return 1;
        }

        return 0;
    }
}

@@ -508,9 +508,24 @@
 urn 
-0
+o1.compareTo(o2)
 ;%0A  

Fix string length comparer when attempting to get the same length (A comparator for a tree map can not have the return value 0, since the key is not inserted then)