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 testRe2jMatcherFactory() {
    Re2jPattern re2jPattern = new Re2jPattern("pattern");
    Matcher matcher = MatcherFactory.matcher(re2jPattern, "");
    Assert.assertTrue(matcher instanceof Re2jMatcher);
  }