@Test(expected = IllegalArgumentException.class)
public void pathTemplateCreateShouldFailIfTwoTemplateWithSameNameAreDetected() throws Exception {

    try {
        RegexPathTemplate.create("http://localhost/{template-name}/{template-name:[a-z]{2}}");
    } catch (Exception e) {
        assertEquals("Template name 'template-name' is already defined!", e.getMessage());
        throw e;
    }
}