private static String getServicePath(URI uri) {
        try (TemporaryThreadLocals tempThreadLocals = TemporaryThreadLocals.acquire()) {
            final StringBuilder bufferedBuilder = tempThreadLocals.stringBuilder();
            bufferedBuilder.append(nullOrEmptyToSlash(uri.getRawPath()));
            final String query = uri.getRawQuery();
            if (query != null) {
                bufferedBuilder.append('?').append(query);
            }
            final String fragment = uri.getRawFragment();
            if (fragment != null) {
                bufferedBuilder.append('#').append(fragment);
            }
            return bufferedBuilder.toString();
        }
    }
Extracts path, query and fragment portions of the {@link URI}.
resteasy/src/main/java/com/linecorp/armeria/client/resteasy/ArmeriaJaxrsClientEngine.java