code: public static CharSequence getFormattedText(List<Span> spans) {
          CharSequence formattedText = null;
  
          if (spans != null) {
              int size = spans.size();
              List<SpannableString> spannableStrings = new ArrayList<>(size);
  
              for (Span span : spans) {
                  SpannableString ss = setUpSpannableString(span);
                  spannableStrings.add(ss);
              }
  
              formattedText = TextUtils.concat(spannableStrings.toArray(new SpannableString[size]));
          }
  
          return formattedText;
      }
docs: Set multiple spans