@Test
public void testFilterSubpath() {

    String path = "/profiles/123456789/email/test@test.com/user/extra";
    String expr = "/profiles/{organization}/email/{email}/user";
    PathFilter regexpPathUriFilter = new DefaultPathFilter("XXX", expr);
    String result = regexpPathUriFilter.filter(path);
    assertThat(result, is("/profiles/XXX/email/XXX/user/extra"));
}