static URI normalizeSyntax(final URI uri) throws URISyntaxException {
        if (uri.isOpaque() || uri.getAuthority() == null) {
            // opaque and file: URIs
            return uri;
        }
        Args.check(uri.isAbsolute(), "Base URI must be absolute");
        final URIBuilder builder = new URIBuilder(uri);
        final String path = builder.getPath();
        if (path != null && !path.equals("/")) {
            final String[] inputSegments = path.split("/");
            final Stack<String> outputSegments = new Stack<>();
            for (final String inputSegment : inputSegments) {
                if ((inputSegment.isEmpty()) || (".".equals(inputSegment))) {
                    // Do nothing
                } else if ("..".equals(inputSegment)) {
                    if (!outputSegments.isEmpty()) {
                        outputSegments.pop();
                    }
                } else {
                    outputSegments.push(inputSegment);
                }
            }
            final StringBuilder outputBuffer = new StringBuilder();
            for (final String outputSegment : outputSegments) {
                outputBuffer.append('/').append(outputSegment);
            }
            if (path.lastIndexOf('/') == path.length() - 1) {
                // path.endsWith("/") || path.equals("")
                outputBuffer.append('/');
            }
            builder.setPath(outputBuffer.toString());
        }
        if (builder.getScheme() != null) {
            builder.setScheme(builder.getScheme().toLowerCase(Locale.ROOT));
        }
        if (builder.getHost() != null) {
            builder.setHost(builder.getHost().toLowerCase(Locale.ROOT));
        }
        return builder.build();
    }
Removes dot segments according to RFC 3986, section 5.2.4 and
Syntax-Based Normalization according to RFC 3986, section 6.2.2.

@param uri the original URI
@return the URI without dot segments
ngrinder-runtime/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java