@Test
public void labelsMustNotEndWithQuestionMark() {

    Throwable thrown = Assertions.assertThrows(InvalidUriPatternException.class, () -> UriPattern.parse("/foo?"));
    assertThat(thrown.getMessage(), containsString("URI patterns must not end with '?'"));
}