VersionSortComparator implements Comparator<String> { public static String[] parts(String arg) { return arg.split("-|\\."); }  static String[] parts(String arg); int versionCompare(String s1, String s2); @Override int compare(String v1, String v2);  }
@Test void testSplit() { Assertions.assertThat(Arrays.asList(VersionSortComparator.parts("app-3.1.1"))).isEqualTo(Arrays.asList("app", "3", "1", "1")); assertThat(Arrays.asList(VersionSortComparator.parts("app-3.1.1-abc"))).isEqualTo(Arrays.asList("app", "3", "1", "1", "abc")); }