public static org.apache.pinot.common.utils.regex.Matcher matcher(Pattern pattern, CharSequence input) {
    if (pattern instanceof Re2jPattern) {
      return new Re2jMatcher(pattern, input);
    } else {
      return new JavaUtilMatcher(pattern, input);
    }
  }
@Test
  public void testJavaUtilMatcherFactory() {
    JavaUtilPattern javaUtilPattern = new JavaUtilPattern("pattern");
    Matcher matcher = MatcherFactory.matcher(javaUtilPattern, "");
    Assert.assertTrue(matcher instanceof JavaUtilMatcher);
  }