private URI rebuildUri(String url, URI uri) {
        final Optional<URI> optionalUri = formatUri(url, uri);
        if (optionalUri.isPresent()) {
            return optionalUri.get();
        }
        throw new IllegalArgumentException("Invalid url: " + url);
    }
@Test
    public void rebuildUriTest() {
        Optional<Method> method = ReflectUtils.findMethod(RestTemplateInterceptor.class, "rebuildUri",
            new Class[]{String.class, URI.class});
        URI uri = createURI(url);
        if (method.isPresent()) {
            Optional<Object> uriNew = ReflectUtils
                .invokeMethod(interceptor, method.get(), new Object[]{convertUrl, uri});
            Assert.assertEquals(convertUrl, uriNew.get().toString());
        }
    }