code: public static boolean contains(final boolean caseSensitive, final CharSequence text, final CharSequence fragment) {
  
          if (text == null) {
              throw new IllegalArgumentException("Text cannot be null");
          }
          if (fragment == null) {
              throw new IllegalArgumentException("Fragment cannot be null");
          }
  
          if (text instanceof String && fragment instanceof String) {
              // Technically, String#contains(...) allows a CharSequence as an argument, so the
              // 'fragment instanceof String' would not be necessary. But it seems String#contains(...) in turn
              // calls .toString() on the CharSequence argument, which would be inconvenient.
              return (caseSensitive ? ((String)text).contains(fragment) : contains(caseSensitive, text, 0, text.length(), fragment, 0, fragment.length()));
          }
  
          return contains(caseSensitive, text, 0, text.length(), fragment, 0, fragment.length());
  
      }
docs: <p>
  Checks whether a text contains a specific fragment.
  </p>
  
  @param caseSensitive whether the comparison must be done in a case-sensitive or case-insensitive way.
  @param text the text to be checked for fragments.
  @param fragment the fragment to be searched.
  @return whether the text contains the fragment or not.