code: @Deprecated
      public int spanAndCount(CharSequence s, int start, SpanCondition spanCondition, OutputInt outCount) {
          if (outCount == null) {
              throw new IllegalArgumentException("outCount must not be null");
          }
          int end = s.length();
          if (start < 0) {
              start = 0;
          } else if (start >= end) {
              return end;
          }
          if (stringSpan != null) {
              // We might also have bmpSet != null,
              // but fully-contained strings are relevant for counting elements.
              return stringSpan.spanAndCount(s, start, spanCondition, outCount);
          } else if (bmpSet != null) {
              return bmpSet.span(s, start, spanCondition, outCount);
          } else if (!strings.isEmpty()) {
              int which = spanCondition == SpanCondition.NOT_CONTAINED ? UnicodeSetStringSpan.FWD_UTF16_NOT_CONTAINED
                      : UnicodeSetStringSpan.FWD_UTF16_CONTAINED;
              which |= UnicodeSetStringSpan.WITH_COUNT;
              UnicodeSetStringSpan strSpan = new UnicodeSetStringSpan(this, new ArrayList<String>(strings), which);
              return strSpan.spanAndCount(s, start, spanCondition, outCount);
          }
  
          return spanCodePointsAndCount(s, start, spanCondition, outCount);
      }
docs: Same as span() but also counts the smallest number of set elements on any path across the span.
  <p>To replace, count elements, or delete spans, see {@link android.icu.text.UnicodeSetSpanner UnicodeSetSpanner}.
  @param outCount An output-only object (must not be null) for returning the count.
  @return the limit (exclusive end) of the span
  @deprecated This API is ICU internal only.
  @hide original deprecated declaration
  @hide draft / provisional / internal are hidden on Android