public static boolean match(String pattern, String string) {
      assertSingleByte(string);
      return match(pattern.getBytes(StandardCharsets.US_ASCII), string.getBytes(StandardCharsets.US_ASCII));
   }
@Test
   public void testValidInputs() {
      assertFalse(GlobMatcher.match("a*b", "aaa"));
      assertFalse(GlobMatcher.match("a*a*b", "aaaa"));

      // Hangs when parsing as regex.
      assertFalse(GlobMatcher.match("a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*b", "a".repeat(55)));

      assertTrue(GlobMatcher.match("a*a*b", "aaa7b"));
      assertTrue(GlobMatcher.match("a*a*b[", "aaa7b["));
      assertFalse(GlobMatcher.match("a*a*b[", "aaa7b[c"));
      assertTrue(GlobMatcher.match("a*[0-9]b", "aH5b"));
      assertTrue(GlobMatcher.match("a*[k\\-0-9]b", "aHk5b"));
      assertTrue(GlobMatcher.match("a*[k\\-0-9]b", "aH-5b"));
      assertFalse(GlobMatcher.match("a*[k\\-0-9]b", "aHb"));
      assertFalse(GlobMatcher.match("a*[0-9]b", "aHRb"));
      assertTrue(GlobMatcher.match("a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*b", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"));
      assertTrue(GlobMatcher.match("hello_[24]", "hello_4"));
      assertTrue(GlobMatcher.match("hello_[24]", "hello_2"));
   }