code: @Override
      public int matches(Replaceable text,
                         int[] offset,
                         int limit,
                         boolean incremental) {
          int c;
          if (offset[0] < limit &&
              contains(c = text.char32At(offset[0]))) {
              offset[0] += UTF16.getCharCount(c);
              return U_MATCH;
          }
          if (offset[0] > limit && contains(text.char32At(offset[0]))) {
              // Backup offset by 1, unless the preceding character is a
              // surrogate pair -- then backup by 2 (keep offset pointing at
              // the lead surrogate).
              --offset[0];
              if (offset[0] >= 0) {
                  offset[0] -= UTF16.getCharCount(text.char32At(offset[0])) - 1;
              }
              return U_MATCH;
          }
          if (incremental && offset[0] == limit) {
              return U_PARTIAL_MATCH;
          }
          return U_MISMATCH;
      }
docs: Default implementation of UnicodeMatcher::matches() for Unicode
  filters.  Matches a single 16-bit code unit at offset.