import com.tuenti.supernanny.util.Versions;
public class VersionTest {
@Test
public void getLatestAllNumbers() {
Version[] versions = new Version[]{new Version("1.2.3"), new Version("1.2.4")};
Assert.assertEquals("Wrong latest version", new Version("1.2.4"), Versions.getLatestVersion(versions));
versions = new Version[]{new Version("1.3.3"), new Version("1.2.4")};
Assert.assertEquals("Wrong latest version", new Version("1.3.3"), Versions.getLatestVersion(versions));
// verify numbers are not compared lexicographically
versions = new Version[]{new Version("10.0.0"), new Version("2.1.1")};
Assert.assertEquals("Wrong latest version", new Version("10.0.0"), Versions.getLatestVersion(versions));
}