@Test
public void patternsMustNotContainFragments() {

    Throwable thrown = Assertions.assertThrows(InvalidUriPatternException.class, () -> UriPattern.parse("/foo#bam"));
    assertThat(thrown.getMessage(), containsString("URI pattern must not contain a fragment"));
}