class GitPathUtil {

    public static Optional<String> extractBranch(final String uri) {
        final Matcher matcher = branchNameExtractorFromPath.matcher(uri);
        if (matcher.matches()) {
            return Optional.of(matcher.group(1));
        } else {
            return Optional.empty();
        }
    }

}