@Override
    public void modifyPath(Function<String, String> pathModifier) {
        request.setHttpURI(HttpURI.build(request.getHttpURI()).path(pathModifier.apply(request.getHttpURI().getPath())).asImmutable());
    }
@Test
    public void shouldAlterRequestUriOnRequest() {
        when(request.getHttpURI()).thenReturn(HttpURI.from("foo/bar/baz?a=b&c=d"));

        jettyRequest.modifyPath(path -> path.replaceAll("^foo/bar/baz", "foo/junk"));
        verify(request).setHttpURI(capturedUri.capture());
        assertThat(capturedUri.getValue().getPath()).isEqualTo("foo/junk");
        assertThat(capturedUri.getValue().getQuery()).isEqualTo("a=b&c=d");
    }