private OptionalInt compareWords(String firstWord, String secondWord) {
        // If they are completely equal, continue to the next word.
        if (firstWord.equals(secondWord)) {
            return OptionalInt.empty();
        }

        // Snapshots are considered < than everything.
        if ("SNAPSHOT".equals(firstWord)) {
            return OptionalInt.of(-1);
        } else if ("SNAPSHOT".equals(secondWord)) {
            return OptionalInt.of(1);
        }

        // Releases are considered > than everything.
        if ("RELEASE".equals(firstWord)) {
            return OptionalInt.of(1);
        } else if ("RELEASE".equals(secondWord)) {
            return OptionalInt.of(-1);
        }

        // Since neither is a release, an early access is > than everything else.
        if ("EA".equals(firstWord)) {
            return OptionalInt.of(1);
        } else if ("EA".equals(secondWord)) {
            return OptionalInt.of(-1);
        }

        final OptionalInt c = compareNonNumericChars(firstWord, secondWord);
        return c.isPresent() ? c : OptionalInt.empty();
    }
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