@Override
    public int compare(String first, String second) {
        if (first == null || second == null) {
            return first == null ? 1 : -1;
        } else {
            final String[] firstWords  = first.split("(\\.|-)");
            final String[] secondWords = second.split("(\\.|-)");
            for (int i = 0; i < Math.min(firstWords.length, secondWords.length); i++) {
                final OptionalInt j = compareWords(firstWords[i], secondWords[i]);
                if (j.isPresent()) return j.getAsInt();
            }

            // If first has more words, it is considered greater
            // (1.0 > 1.0-SNAPSHOT)
            if (firstWords.length < secondWords.length) {
                return 1;
            } else if (firstWords.length > secondWords.length) {
                return -1;
            } else {
                return 0;
            }
        }
    }
Specialized String Comparator that evaluated two versions as semantic
versions.

@author Emil Forslund
@since  3.0.10
tool-parent/tool-core/src/main/java/com/speedment/tool/core/internal/util/SemanticVersionComparator.java