code: static int subSequenceEquals(
          CharSequence test,
          int offset,
          CharSequence expected,
          boolean caseInsensitive,
          boolean rtl
      ) {
  
          int j = 0;
          int max = test.length();
          int len = expected.length();
  
          for (int i = 0; i < len; i++) {
              char c = '\u0000';
              char exp = expected.charAt(i);
  
              if (isBidi(exp)) {
                  continue; // always ignore bidis in pattern when parsing
              }
  
              if (rtl) {
                  while ((j + offset < max) && isBidi(c = test.charAt(j + offset))) {
                      j++;
                  }
              } else if (j + offset < max) {
                  c = test.charAt(j + offset);
              }
  
              if (j + offset >= max) {
                  return -1;
              } else {
                  j++;
              }
  
              if (caseInsensitive) {
                  if (!charEqualsIgnoreCase(c, exp)) {
                      return -1;
                  }
              } else if (c != exp) {
                  return -1;
              }
          }
  
          if (rtl) {
              while ((j + offset < max) && isBidi(test.charAt(j + offset))) {
                  j++;
              }
          }
  
          return j;
  
      }
docs: also used by LocalizedGMTProcessor