public static String normalizePath(String path) {
        if (StringUtils.isBlank(path)) {
            return "/";
        } else {
            boolean startsWithSlash = path.startsWith("/");
            boolean endsWithSlash = path.endsWith("/");
            if (startsWithSlash && endsWithSlash) {
                return path;
            } else if (startsWithSlash) {
                return path + "/";
            } else if (endsWithSlash) {
                return "/" + path;
            } else {
                return "/" + path + "/";
            }
        }
    }
Normalizes a path string according to the ParseURL function.

@param path Path string to normalize.
@return the normalized path.
smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/ParseUrl.java