### Question:
Version implements Comparable<Version> { @Override public int compareTo(Version o) { if(o == null) { return 1; } int major1 = getMajor(), major2 = o.getMajor(); if(major1 != major2) { return major2 - major1; } int minor1 = getMinor(), minor2 = o.getMinor(); if(minor1 != minor2) { return minor2 - minor1; } int patch1 = hasPatch() ? getPatch() : 0; int patch2 = o.hasPatch() ? o.getPatch() : 0; if(patch1 != patch2) { return patch2 - patch1; } int build1 = hasBuild() ? getBuild() : 0; int build2 = o.hasBuild() ? o.getBuild() : 0; if(build1 != build2) { return build2 - build1; } String q1 = hasQualifier() ? getQualifier() : null; String q2 = o.hasQualifier() ? o.getQualifier() : null; return ObjectUtils.compare(q2, q1, true); } Version(int major);  Version(int major, int minor);  Version(int major, int minor, @Nullable String qualifier); private  Version(int major, int minor, @Nullable String qualifier, String representation);   Version(int major, int minor, @Nullable Integer patch, @Nullable Integer build, @Nullable String qualifier, String representation); static Version fromRepresentation(String version); @Nullable static Version findNewest(Iterable<Version> versions); @Nullable static Version findNewest(Iterable<Version> versions, String qualifier); int getMajor(); int getMinor(); boolean hasQualifier(); String getQualifier(); String getRepresentation(); boolean hasPatch(); Integer getPatch(); boolean hasBuild(); Integer getBuild(); @Override int compareTo(Version o); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static final Version UNVERSIONED; }### Answer:
@Test public void testCompareTo() { assertTrue(Version.fromRepresentation("2.0.1.045").compareTo(Version.fromRepresentation("2.0.1.038")) < 0); assertTrue(Version.fromRepresentation("2.0.1.045").compareTo(Version.fromRepresentation("2.0.1.045")) == 0); assertTrue(Version.fromRepresentation("2.0.1.045").compareTo(Version.fromRepresentation("2.0.1.058")) > 0); }