### Question:
ComparableVersion implements Comparable<ComparableVersion> { @Override public int compareTo(ComparableVersion o) { return items.compareTo(o.items); } ComparableVersion(String version); final void parseVersion(String version); @Override int compareTo(ComparableVersion o); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testVersionClassicComparator() { ComparableVersion greatest = new ComparableVersion("2.1.0"); ComparableVersion lesser = new ComparableVersion("2.0.9"); ComparableVersion eqVersion = new ComparableVersion("2.0.9"); assert(greatest.compareTo(lesser) > 0); assert(lesser.compareTo(greatest) < 0); assert(lesser.compareTo(eqVersion) == 0); }
@Test public void testVersionLesserSnapshotComparator() { ComparableVersion release = new ComparableVersion("2.1.0"); ComparableVersion snapshot = new ComparableVersion("2.1.0-SNAPSHOT"); assert(release.compareTo(snapshot) > 0); }
@Test public void testVersionGreatestSnapshotComparator() { ComparableVersion release = new ComparableVersion("2.0.9"); ComparableVersion snapshot = new ComparableVersion("2.1.0-SNAPSHOT"); assert(release.compareTo(snapshot) < 0); }
@Test public void testVersionComparator() { ComparableVersion release = new ComparableVersion("2.0.9"); ComparableVersion releaseWithQuickFix = new ComparableVersion("2.0.9-1"); assert(release.compareTo(releaseWithQuickFix) < 0); }