@Test
public void greedyLabelsMustBeLastLabelInPattern() {

    Throwable thrown = Assertions.assertThrows(InvalidPatternException.class, () -> {
        String target = "/{foo+}/{baz}";
        SmithyPattern.builder()
                .segments(parser(target))
                .pattern(target)
                .build();
    });
    assertThat(thrown.getMessage(), containsString("A greedy label must be the last label in its pattern"));
}