@Override
    public int compareTo(final Version that) {
        String[] thisParts = version.split("\\.");
        String[] thatParts = that.version.split("\\.");
        int length = Math.max(thisParts.length, thatParts.length);
        for(int i = 0; i < length; i++) {
            int thisPart = i < thisParts.length ? Integer.parseInt(thisParts[i]) : 0;
            int thatPart = i < thatParts.length ? Integer.parseInt(thatParts[i]) : 0;
            if(thisPart < thatPart) {
                return -1;
            }
            if(thisPart > thatPart) {
                return 1;
            }
        }
        return 0;
    }
@Test
    public void testCompare() {
        assertEquals(0, new Version("4").compareTo(new Version("4")));
        assertEquals(0, new Version("4.1").compareTo(new Version("4.1")));
        assertEquals(0, new Version("4.12").compareTo(new Version("4.12")));
        assertEquals(-1, new Version("4.12").compareTo(new Version("4.22")));
        assertEquals(-1, new Version("4.12.9").compareTo(new Version("4.22")));
        assertEquals(-1, new Version("4.12.9-LTS").compareTo(new Version("4.22")));
        assertEquals(1, new Version("4.22").compareTo(new Version("4.12")));
        assertEquals(1, new Version("4.22").compareTo(new Version("4.12.9")));
        assertEquals(1, new Version("4.22").compareTo(new Version("4.12.9-LTS")));
        assertEquals(-1, new Version("4.20").compareTo(new Version("4.30")));
        assertEquals(0, new Version("4.30").compareTo(new Version("4.30")));
    }