@Test public void testGuava() { Assert.assertEquals(0, comparator.compare("20.0", "20.0")); Assert.assertTrue(comparator.compare("20.0", "10.0") > 0); Assert.assertTrue(comparator.compare("10.0", "20.0") < 0); Assert.assertTrue(comparator.compare("20.0.1", "20.0") > 0); Assert.assertTrue(comparator.compare("20.0.1", "20.0.0") > 0); Assert.assertTrue(comparator.compare("25.1-jre", "25.1-android") > 0); }
@Override public int compare(String version1, String version2) { return new ComparableVersion(version1).compareTo(new ComparableVersion(version2)); }
VersionComparator implements Comparator<String> { @Override public int compare(String version1, String version2) { return new ComparableVersion(version1).compareTo(new ComparableVersion(version2)); } }
VersionComparator implements Comparator<String> { @Override public int compare(String version1, String version2) { return new ComparableVersion(version1).compareTo(new ComparableVersion(version2)); }  }
VersionComparator implements Comparator<String> { @Override public int compare(String version1, String version2) { return new ComparableVersion(version1).compareTo(new ComparableVersion(version2)); }  @Override int compare(String version1, String version2); }
VersionComparator implements Comparator<String> { @Override public int compare(String version1, String version2) { return new ComparableVersion(version1).compareTo(new ComparableVersion(version2)); }  @Override int compare(String version1, String version2);  }