public static Object[][] generateParameters() {

        return Stream.of(
                        new Object[] {"/foo/*", createRequest("/foo/"), true},
                        new Object[] {"/foo*", createRequest("/foo/"), true},
                        new Object[] {"/foo", createRequest("/foo/"), true},

                        new Object[] {"/foo/*", createRequest("/foo/bar"), true},
                        new Object[] {"/foo*", createRequest("/foo/bar"), false},
                        new Object[] {"/foo", createRequest("/foo/bar"), false},

                        new Object[] {"/foo", createRequest("/foo"), true},
                        new Object[] {"/foo/*", createRequest("/foo"), false},
                        new Object[] {"/foo/*", createRequest("/foo "), false},
                        new Object[] {"/foo/*", createRequest("/foo /"), false},
                        // already URL decoded, encoded would have been %2520
                        new Object[] {"/foo/*", createRequest("/foo%20"), false},
                        new Object[] {"/foo/*", createRequest("/foo%20/"), false},
                        new Object[] {"/foo/*", createRequest("/foo/%20/"), true},
                        new Object[] {"/foo/*", createRequest("/foo/ /"), true}
                )
                .toArray(Object[][]::new);
    }
Tests the following assumptions:

<pre>
URL                 Must match pattern      Must not match pattern
/foo/               /foo/*                  /foo* || /foo
/foo/bar            /foo/*                  /foo* || /foo
/foo                /foo                    /foo/*
</pre>
web/src/test/java/org/apache/shiro/web/filter/PathMatchingFilterParameterizedTest.java