@Override
    public int compareTo(Version that) {
        if (that == null) {
            return 1;
        }
        int result = Integer.compare(getMajor(), that.getMajor());
        if (result == 0) {
            result = Integer.compare(getMinor(), that.getMinor());
            if (result == 0) {
                result = Integer.compare(getMicro(), that.getMicro());
                if (result == 0) {
                    // OF-2941: Hacky solution to allow for four-digit SNAPSHOT version comparison.
                    if (that.status == ReleaseStatus.Snapshot || status == ReleaseStatus.Snapshot) {
                        result = Integer.compare(getStatusVersion(), that.getStatusVersion());
                        if (result == 0) {
                            result = that.getStatus().compareTo(getStatus());
                        }
                    } else {
                        result = that.getStatus().compareTo(getStatus());
                        if (result == 0) {
                            result = Integer.compare(getStatusVersion(), that.getStatusVersion());
                        }
                    }
                }
            }
        }
        return result;
    }
Convenience method for comparing versions

@param otherVersion a version to compare against
@return {@code true} if this version is newer, otherwise {@code false}
xmppserver/src/main/java/org/jivesoftware/util/Version.java