### Question:
Version implements Comparable<Version> { @Nullable public static Version findNewest(Iterable<Version> versions) { return findNewest(versions, ""); } 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 testFindNewest() { List<Version> versions = Arrays.asList( Version.fromRepresentation("1.0-alpha"), Version.fromRepresentation("1.0"), Version.fromRepresentation("1.1-alpha"), Version.fromRepresentation("1.1"), Version.fromRepresentation("1.2"), Version.fromRepresentation("2.104"), Version.fromRepresentation("3.0-beta") ); assertEquals(Version.fromRepresentation("2.104"), Version.findNewest(versions)); assertEquals(Version.fromRepresentation("1.1-alpha"), Version.findNewest(versions, "alpha")); assertEquals(Version.fromRepresentation("3.0-beta"), Version.findNewest(versions, "beta")); assertEquals(null, Version.findNewest(versions, "gamma")); }