@Override
    public int compareTo(@Nonnull Version that) {
        requireNonNull(that);
        return version.compareTo(that.getVersion());
    }
@Test
    public void testCompareTo() {
        Version v = Version.from(0, 20, 2);

        assertTrue(v.compareTo(Version.from(0, 19, 0)) > 0);
        assertTrue(v.compareTo(Version.from(0, 18, 2)) > 0);
        assertTrue(v.compareTo(Version.from(0, 19, 9001)) > 0);

        assertTrue(v.compareTo(Version.from(0, 20, 2)) == 0);
        assertTrue(v.compareTo(Version.from(0, 20, 0)) > 0);
        assertTrue(v.compareTo(Version.from(1, 0, 0)) < 0);
        assertTrue(v.compareTo(Version.from(1, 0, 9001)) < 0);
        assertTrue(v.compareTo(Version.from(1, 20, 0)) < 0);
        assertTrue(v.compareTo(Version.from(1, 1, 0)) < 0);
        assertTrue(v.compareTo(Version.from(3, 2, 1)) < 0);

        assertTrue(v.compareTo(Version.from(0, 19, 0, "rc.1")) > 0);
        assertTrue(v.compareTo(Version.from(1, 19, 0, "rc.1")) < 0);
        assertTrue(v.compareTo(Version.from(0, 21, 0, "rc.1")) < 0);
        assertTrue(v.compareTo(Version.from(0, 20, 1, "rc.1")) > 0);
        assertTrue(v.compareTo(Version.from(0, 20, 0, "rc.1")) > 0);
        assertTrue(v.compareTo(Version.from(0, 20, 2, "rc.1")) > 0);
        assertTrue(v.compareTo(Version.from(0, 20, 3, "rc.1")) < 0);

        v = Version.from(1, 5, 0);

        assertTrue(v.compareTo(Version.from(0, 19, 0)) > 0);
        assertTrue(v.compareTo(Version.from(1, 0, 0)) > 0);
        assertTrue(v.compareTo(Version.from(0, 19, 9001)) > 0);
        assertTrue(v.compareTo(Version.from(1, 5, 0)) == 0);
        assertTrue(v.compareTo(Version.from(1, 4, 9)) > 0);

        assertTrue(v.compareTo(Version.from(1, 6, 0)) < 0);
        assertTrue(v.compareTo(Version.from(3, 0, 0)) < 0);
        assertTrue(v.compareTo(Version.from(1, 5, 9001)) < 0);
        assertTrue(v.compareTo(Version.from(1, 20, 0)) < 0);
        assertTrue(v.compareTo(Version.from(1, 20, 5)) < 0);
        assertTrue(v.compareTo(Version.from(3, 2, 1)) < 0);

        assertTrue(v.compareTo(Version.from(0, 19, 0, "rc.1")) > 0);
        assertTrue(v.compareTo(Version.from(2, 19, 0, "rc.1")) < 0);
        assertTrue(v.compareTo(Version.from(0, 0, 0)) > 0);
        assertTrue(v.compareTo(Version.from(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE)) < 0);

        v = Version.from(1, 0, 0, "beta.2");
        assertTrue(v.compareTo(Version.from(1, 0, 0, "beta.1")) > 0);
        assertTrue(v.compareTo(Version.from(1, 0, 0, "beta.2")) == 0);
        assertTrue(v.compareTo(Version.from(1, 0, 0, "beta.3")) < 0);
        assertTrue(v.compareTo(Version.from(1, 0, 0, "alpha.1")) > 0);
        assertTrue(v.compareTo(Version.from(1, 0, 0, "alpha.3")) > 0);
        assertTrue(v.compareTo(Version.from(1, 0, 0, "rc.1")) < 0);
        assertTrue(v.compareTo(Version.from(1, 0, 0, "rc.3")) < 0);
        assertTrue(v.compareTo(Version.from(1, 0, 0)) < 0);
    }