docs: static String generateFragment( String content,
                                      int indexOfProblem,
                                      int charactersToIncludeBeforeAndAfter,
                                      String highlightText ) {
          assert content != null;
          assert indexOfProblem < content.length();
          // Find the substring that immediately precedes the current position ...
          int beforeStart = Math.max(0, indexOfProblem - charactersToIncludeBeforeAndAfter);
          String before = content.substring(beforeStart, indexOfProblem);
  
          // Find the substring that immediately follows the current position ...
          int afterEnd = Math.min(indexOfProblem + charactersToIncludeBeforeAndAfter, content.length());
          String after = content.substring(indexOfProblem, afterEnd);
  
          return before + (highlightText != null ? highlightText : "") + after;
      }