@SuppressWarnings("unchecked")
@Test
public void testRegex()
{

    String pattern = "(/[a-zA-Z0-9\\-_\\.]+)+";
    Object[][] data = array(
            array("/zerze/efrez/ferzr/zerrerre", true),
            array("/zerze/efrez/ferzr/zerrerre.txt", true),
            array("zerzerze/zerzer/rez4re/erzre5z.txd", false),
            array("/zerzer-zrzerze/zerzere_zerzer55ze", true),
            array("/zerzer-zrzerze/zerzere_zerze/", false),
            array("/zeorzeiorize", true)
    );
    for (Object[] array : data)
    {
        String toTest = (String) array[0];
        Boolean assertion = (Boolean) array[1];
        assertThat(matches(pattern, toTest)).isEqualTo(assertion)
                .as("Check that " + toTest + " is " + assertion);
    }
}