PathUtil { public String replaceBranch(final String newBranchName, final String uri) { final Matcher matcher = branchNameReplacer.matcher(uri); return matcher.replaceFirst("$1" + newBranchName.replace("$", "\\$") + "$3"); }  org.uberfire.backend.vfs.Path normalizePath(org.uberfire.backend.vfs.Path path); org.uberfire.java.nio.file.Path convert(org.uberfire.backend.vfs.Path path); org.uberfire.backend.vfs.Path convert(org.uberfire.java.nio.file.Path path); String stripProtocolAndBranch(String uri); String stripRepoNameAndSpace(String strippedPath); String getNiogitRepoPath(org.uberfire.java.nio.file.Path path); Optional<String> extractBranch(String uri); String replaceBranch(final String newBranchName,
                                final String uri);  }
@Test public void replaceBranchName() { final String newUri = pathUtil.replaceBranch("new-branch", "git: assertEquals("git: }
@Test public void replaceMissingBranchName() { final String newUri = pathUtil.replaceBranch("new-branch", "git: assertEquals("git: }
@Test public void replaceBranchNameWith$() { final String newUri = pathUtil.replaceBranch("new$branch", "git: assertEquals("git: }