PatchInstallerUtil { static int comparePatcherPaths(@NotNull String path1, @NotNull String path2) { int v1 = -1; int v2 = -1; try { v1 = Integer.parseInt(path1.substring(path1.lastIndexOf('v') + 1)); } catch (NumberFormatException ignored) { } try { v2 = Integer.parseInt(path2.substring(path2.lastIndexOf('v') + 1)); } catch (NumberFormatException ignored) { } return Integer.compare(v1, v2); }  static File generatePatch(PatchOperation patchOp, File destDir, FileOp fop, ProgressIndicator progress); @Nullable static PackageOperation getInProgressDependantPatcherInstall(@NotNull RemotePackage remote, @NotNull RepoManager mgr); static final String PATCHER_PATH_PREFIX; }
@Test public void comparePaths() throws Exception { assertTrue(PatchInstallerUtil.comparePatcherPaths("patcher;v1", "patcher;v2") < 0); assertTrue(PatchInstallerUtil.comparePatcherPaths("patcher;v2", "patcher;v1") > 0); assertTrue(PatchInstallerUtil.comparePatcherPaths("patcher;v2", "patcher;v2") == 0); assertTrue(PatchInstallerUtil.comparePatcherPaths("bogus", "patcher;v2") < 0); assertTrue(PatchInstallerUtil.comparePatcherPaths("patcher;v1", "bogus") > 0); }