RegexRequestMatcher.regexMatcher(HttpMethod method, String pattern) says in the Javadoc that method "May be null to match all methods." which makes sense as RegexRequestMatcher constructor takes null, but then we have Assert.notNull(method, "method cannot be null") as the first line in the method, which is completely the opposite of what is expected.