class IllegalPipelineMutationException extends RuntimeException {
    IllegalPipelineMutationException() {
      super("Pipeline is frozen; mutating shared JLanguageTool instance is forbidden.");
    }
  }

  private boolean setup = false;

  /**
   * Prevents any further changes after this method was called.
   */
  void setupFinished() {
   this.setup = true;
  }

  Pipeline(Language language, List<Language> altLanguages, Language motherTongue, ResultCache cache, GlobalConfig globalConfig, UserConfig userConfig, boolean inputLogging) {
    super(language, altLanguages, motherTongue, cache, globalConfig, userConfig, inputLogging);
  }

  @Override
  public void setCleanOverlappingMatches(boolean cleanOverlappingMatches) {
    preventModificationAfterSetup();
    super.setCleanOverlappingMatches(cleanOverlappingMatches);
  }

  private void preventModificationAfterSetup() {
    if (setup) {
      throw new IllegalPipelineMutationException();
    }
  }

  @Override
  public void setMaxErrorsPerWordRate(float maxErrorsPerWordRate) {
    preventModificationAfterSetup();
    super.setMaxErrorsPerWordRate(maxErrorsPerWordRate);
  }

  @Override
  public void setOutput(PrintStream printStream) {
    preventModificationAfterSetup();
    super.setOutput(printStream);
  }

  @Override
  public List<AbstractPatternRule> loadPatternRules(String filename) throws IOException {
    preventModificationAfterSetup();
    return super.loadPatternRules(filename);
  }

  @Override
  public List<AbstractPatternRule> loadFalseFriendRules(String filename) throws ParserConfigurationException, SAXException, IOException {
    preventModificationAfterSetup();
    return super.loadFalseFriendRules(filename);
  }

  @Override
  public void activateLanguageModelRules(File indexDir) throws IOException {
    preventModificationAfterSetup();
    super.activateLanguageModelRules(indexDir);
  }

  @Override
  public void activateRemoteRules(File configFile) throws IOException {
    preventModificationAfterSetup();
    super.activateRemoteRules(configFile);
  }

  @Override
  public void activateRemoteRules(List<RemoteRuleConfig> configs) throws IOException {
    preventModificationAfterSetup();
    super.activateRemoteRules(configs);
  }

  @Override
  public void addMatchFilter(@NotNull RuleMatchFilter filter) {
    preventModificationAfterSetup();
    super.addMatchFilter(filter);
  }

  @Override
  public void addRule(Rule rule) {
    preventModificationAfterSetup();
    super.addRule(rule);
  }

  @Override
  public void disableRule(String ruleId) {
    preventModificationAfterSetup();
    super.disableRule(ruleId);
  }

  @Override
  public void disableRules(List<String> ruleIds) {
    preventModificationAfterSetup();
    super.disableRules(ruleIds);
  }

  @Override
  public void disableCategory(CategoryId id) {
    preventModificationAfterSetup();
    super.disableCategory(id);
  }

  @Override
  public Set<String> getDisabledRules() {
    return Collections.unmodifiableSet(super.getDisabledRules());
  }

  @Override
  public void enableRule(String ruleId) {
    preventModificationAfterSetup();
    super.enableRule(ruleId);
  }

  @Override
  public void enableRuleCategory(CategoryId id) {
    preventModificationAfterSetup();
    super.enableRuleCategory(id);
  }

  @Override
  public List<String> getUnknownWords() {
    return Collections.unmodifiableList(super.getUnknownWords());
  }

  @Override
  public Map<CategoryId, Category> getCategories() {
    return Collections.unmodifiableMap(super.getCategories());
  }

  @Override
  public List<Rule> getAllRules() {
    return Collections.unmodifiableList(super.getAllRules());
  }

  @Override
  public List<Rule> getAllActiveRules() {
    return Collections.unmodifiableList(super.getAllActiveRules());
  }

  @Override
  public List<Rule> getAllActiveOfficeRules() {
    return Collections.unmodifiableList(super.getAllActiveOfficeRules());
  }

  @Override
  public List<AbstractPatternRule> getPatternRulesByIdAndSubId(String Id, String subId) {
    return Collections.unmodifiableList(super.getPatternRulesByIdAndSubId(Id, subId));
  }

  @Override
  public void setConfigValues(Map<String, Integer> v) {
    preventModificationAfterSetup();
    super.setConfigValues(v);
  }

  /**
   * exposed here for GRPCServer
   */
  CheckResults checkAnalyzedSentences(List<AnalyzedSentence> analyzed, RuleMatchListener listener) throws Exception {<FILL_FUNCTION_BODY>

    // TODO use checkInternal again
    List<String> sentences = analyzed.stream().map(AnalyzedSentence::getText).collect(Collectors.toList());
    String text = sentences.stream().collect(Collectors.joining());
    AnnotatedText annotated = new AnnotatedTextBuilder().addText(text).build();
    return checkInternal(annotated, ParagraphHandling.NORMAL, listener, Mode.ALL, Level.DEFAULT, null, sentences, analyzed);
  
<methods>public void <init>(org.languagetool.Language, org.languagetool.Language) ,public void <init>(org.languagetool.Language) ,public void <init>(org.languagetool.Language, org.languagetool.Language, org.languagetool.ResultCache) ,public void <init>(org.languagetool.Language, org.languagetool.ResultCache, org.languagetool.UserConfig) ,public void <init>(org.languagetool.Language, List<org.languagetool.Language>, org.languagetool.Language, org.languagetool.ResultCache, org.languagetool.GlobalConfig, org.languagetool.UserConfig) ,public void <init>(org.languagetool.Language, List<org.languagetool.Language>, org.languagetool.Language, org.languagetool.ResultCache, org.languagetool.GlobalConfig, org.languagetool.UserConfig, boolean) ,public void <init>(org.languagetool.Language, org.languagetool.Language, org.languagetool.ResultCache, org.languagetool.UserConfig) ,public void activateLanguageModelRules(java.io.File) throws java.io.IOException,public void activateRemoteRules(java.io.File) throws java.io.IOException,public void activateRemoteRules(List<org.languagetool.rules.RemoteRuleConfig>) throws java.io.IOException,public void addMatchFilter(org.languagetool.rules.RuleMatchFilter) ,public void addRule(org.languagetool.rules.Rule) ,public static void addTemporaryFile(java.io.File) ,public org.languagetool.rules.RuleMatch adjustRuleMatchPos(org.languagetool.rules.RuleMatch, int, int, int, java.lang.String, org.languagetool.markup.AnnotatedText) ,public List<org.languagetool.AnalyzedSentence> analyzeText(java.lang.String) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(java.lang.String) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(java.lang.String, org.languagetool.JLanguageTool.Level) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(java.lang.String, org.languagetool.RuleMatchListener) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(java.lang.String, boolean, org.languagetool.JLanguageTool.ParagraphHandling) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(java.lang.String, boolean, org.languagetool.JLanguageTool.ParagraphHandling, org.languagetool.RuleMatchListener) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(org.languagetool.markup.AnnotatedText) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(org.languagetool.markup.AnnotatedText, org.languagetool.RuleMatchListener) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(org.languagetool.markup.AnnotatedText, boolean, org.languagetool.JLanguageTool.ParagraphHandling) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(org.languagetool.markup.AnnotatedText, boolean, org.languagetool.JLanguageTool.ParagraphHandling, org.languagetool.RuleMatchListener) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(org.languagetool.markup.AnnotatedText, boolean, org.languagetool.JLanguageTool.ParagraphHandling, org.languagetool.RuleMatchListener, org.languagetool.JLanguageTool.Level) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(org.languagetool.markup.AnnotatedText, boolean, org.languagetool.JLanguageTool.ParagraphHandling, org.languagetool.RuleMatchListener, org.languagetool.JLanguageTool.Mode, org.languagetool.JLanguageTool.Level) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> check(org.languagetool.markup.AnnotatedText, boolean, org.languagetool.JLanguageTool.ParagraphHandling, org.languagetool.RuleMatchListener, org.languagetool.JLanguageTool.Mode, org.languagetool.JLanguageTool.Level, java.lang.Long) throws java.io.IOException,public org.languagetool.CheckResults check2(org.languagetool.markup.AnnotatedText, boolean, org.languagetool.JLanguageTool.ParagraphHandling, org.languagetool.RuleMatchListener, org.languagetool.JLanguageTool.Mode, org.languagetool.JLanguageTool.Level, java.lang.Long) throws java.io.IOException,public org.languagetool.CheckResults check2(org.languagetool.markup.AnnotatedText, boolean, org.languagetool.JLanguageTool.ParagraphHandling, org.languagetool.RuleMatchListener, org.languagetool.JLanguageTool.Mode, org.languagetool.JLanguageTool.Level, Set<org.languagetool.ToneTag>, java.lang.Long) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> checkAnalyzedSentence(org.languagetool.JLanguageTool.ParagraphHandling, List<org.languagetool.rules.Rule>, org.languagetool.AnalyzedSentence) throws java.io.IOException,public List<org.languagetool.rules.RuleMatch> checkAnalyzedSentence(org.languagetool.JLanguageTool.ParagraphHandling, List<org.languagetool.rules.Rule>, org.languagetool.AnalyzedSentence, boolean) throws java.io.IOException,public void disableCategory(org.languagetool.rules.CategoryId) ,public void disableRule(java.lang.String) ,public void disableRules(List<java.lang.String>) ,public void enableRule(java.lang.String) ,public void enableRuleCategory(org.languagetool.rules.CategoryId) ,public List<org.languagetool.rules.Rule> getAllActiveOfficeRules() ,public List<org.languagetool.rules.Rule> getAllActiveRules() ,public List<org.languagetool.rules.Rule> getAllRules() ,public List<org.languagetool.rules.spelling.SpellingCheckRule> getAllSpellingCheckRules() ,public org.languagetool.AnalyzedSentence getAnalyzedSentence(java.lang.String) throws java.io.IOException,public Map<org.languagetool.rules.CategoryId,org.languagetool.rules.Category> getCategories() ,public static synchronized org.languagetool.broker.ClassBroker getClassBroker() ,public static synchronized org.languagetool.broker.ResourceDataBroker getDataBroker() ,public Set<java.lang.String> getDisabledRules() ,public org.languagetool.Language getLanguage() ,public static java.util.ResourceBundle getMessageBundle() ,public static java.util.ResourceBundle getMessageBundle(org.languagetool.Language) ,public List<org.languagetool.rules.patterns.AbstractPatternRule> getPatternRulesByIdAndSubId(java.lang.String, java.lang.String) ,public org.languagetool.AnalyzedSentence getRawAnalyzedSentence(java.lang.String) throws java.io.IOException,public List<java.lang.String> getUnknownWords() ,public boolean isCategoryDisabled(org.languagetool.rules.CategoryId) ,public static boolean isCustomPasswordAuthenticatorUsed() ,public List<org.languagetool.rules.patterns.AbstractPatternRule> loadFalseFriendRules(java.lang.String) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException,public List<org.languagetool.rules.patterns.AbstractPatternRule> loadPatternRules(java.lang.String) throws java.io.IOException,public static void removeTemporaryFiles() ,public List<java.lang.String> sentenceTokenize(java.lang.String) ,public void setCheckCancelledCallback(org.languagetool.JLanguageTool.CheckCancelledCallback) ,public static synchronized void setClassBrokerBroker(org.languagetool.broker.ClassBroker) ,public void setCleanOverlappingMatches(boolean) ,public void setConfigValues(Map<java.lang.String,java.lang.Integer>) ,public static synchronized void setDataBroker(org.languagetool.broker.ResourceDataBroker) ,public void setListUnknownWords(boolean) ,public void setMaxErrorsPerWordRate(float) ,public void setOutput(java.io.PrintStream) ,public static void useCustomPasswordAuthenticator(boolean) <variables>public static final java.lang.String BUILD_DATE,public static final java.lang.String CUSTOM_PATTERN_FILE,public static final java.lang.String DICTIONARY_FILENAME_EXTENSION,public static final java.lang.String FALSE_FRIEND_FILE,public static final java.lang.String GIT_SHORT_ID,public static final java.lang.String MESSAGE_BUNDLE,public static final java.lang.String PARAGRAPH_END_TAGNAME,public static final java.lang.String PATTERN_FILE,public static final java.lang.String SENTENCE_END_TAGNAME,public static final java.lang.String SENTENCE_START_TAGNAME,public static final java.lang.String STYLE_FILE,public static final java.lang.String VERSION,private static final java.util.regex.Pattern ZERO_WIDTH_NBSP,private final non-sealed List<org.languagetool.Language> altLanguages,private final non-sealed List<org.languagetool.rules.Rule> builtinRules,private final non-sealed org.languagetool.ResultCache cache,private org.languagetool.JLanguageTool.CheckCancelledCallback checkCancelledCallback,private static org.languagetool.broker.ClassBroker classBroker,private boolean cleanOverlappingMatches,private static org.languagetool.broker.ResourceDataBroker dataBroker,private final non-sealed org.languagetool.ShortDescriptionProvider descProvider,private final Set<org.languagetool.rules.CategoryId> disabledRuleCategories,private final Set<java.lang.String> disabledRules,private final Set<org.languagetool.rules.CategoryId> enabledRuleCategories,private final Set<java.lang.String> enabledRules,private final non-sealed org.languagetool.GlobalConfig globalConfig,private final non-sealed boolean inputLogging,private final non-sealed org.languagetool.Language language,private boolean listUnknownWords,private static final Logger logger,private final List<org.languagetool.rules.RuleMatchFilter> matchFilters,private float maxErrorsPerWordRate,private final non-sealed org.languagetool.Language motherTongue,private final Set<java.lang.String> optionalLanguageModelRules,private java.io.PrintStream printStream,private final Map<org.languagetool.LevelToneTagCacheKey,org.languagetool.rules.patterns.RuleSet> ruleSetCache,private static final List<java.io.File> temporaryFiles,private Set<java.lang.String> unknownWords,private static volatile boolean useCustomPasswordAuthenticator,private final non-sealed org.languagetool.UserConfig userConfig,private final List<org.languagetool.rules.Rule> userRules