### Question:
Version implements Comparable<Version> { @Override public int compareTo(final Version version) { if (this.equals(version)) { return 0; } if (this.major > version.major) { return 1; } if (this.major < version.major) { return -1; } if (this.minor > version.minor) { return 1; } if (this.minor < version.minor) { return -1; } if (this.patch > version.patch) { return 1; } return -1; } Version(final int major, final int minor, final int patch); static Version fromString(final String version); @Override String toString(); int getMajor(); int getMinor(); int getPatch(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override int compareTo(final Version version); static Range<Version> createRangeOf(final Version from, final Version to); static final Version NULL; static final String NULL_VERSION_STRING; }### Answer:
@Test public void testCompareTo() throws Exception { Version version1227 = Version.fromString("1.2.27"); Version version1200 = Version.fromString("1.2.0"); assertTrue(version1227.compareTo(version1200) > 0); assertTrue(version1200.compareTo(version1227) < 0); Version version1990 = Version.fromString("1.99.0"); assertTrue(version1227.compareTo(version1990) < 0); assertTrue(version1990.compareTo(version1200) > 0); Version version9910 = Version.fromString("99.1.0"); assertTrue(version9910.compareTo(version1227) > 0); assertTrue(version1200.compareTo(version9910) < 0); }