protected void assertSyntaxError(String pattern) {
    try {
      matcher(pattern);
      fail();
    } catch (PatternSyntaxException expected) {
    }

    try {
      PathMatcher real = realMatcher(pattern);
      if (real != null) {
        fail();
      }
    } catch (PatternSyntaxException expected) {
    }
  }
Override to return a real matcher for the given pattern.
jimfs/src/test/java/com/google/common/jimfs/AbstractPathMatcherTest.java