@Test
    public void testSetters() {
        final Collection<String> excludedPaths = new HashSet<>();
        excludedPaths.add("/foo");
        final Collection<String> excludedRegexs = new HashSet<>();
        excludedRegexs.add("^/(img/.*|css/.*|page\\.html)$");

        val matcher = new PathMatcher();
        matcher.setExcludedPaths(excludedPaths);
        matcher.setExcludedPatterns(excludedRegexs);

        assertFalse(matcher.matches(new CallContext(MockWebContext.create().setPath("/foo"), new MockSessionStore())));
        assertTrue(matcher.matches(new CallContext(MockWebContext.create().setPath("/foo/"),
            null))); // because its a fixed path, not a regex

        assertTrue(matcher.matches(new CallContext(MockWebContext.create().setPath("/error/500.html"), new MockSessionStore())));
        assertFalse(matcher.matches(new CallContext(MockWebContext.create().setPath("/img/"), new MockSessionStore())));
    }
Tests {@link PathMatcher}.

@author Rob Ward
@since 2.0.0
pac4j-core/src/test/java/org/pac4j/core/matching/matcher/PathMatcherTests.java