@Override
    public void simplify() {
      prepareSortedCases();

      if (myCleaner != null) {
        myCleaner.run();
      }
      resort(myRootSwitchStatement, mySortedCasesFromRoot);
      Exprent headExprent = myRootSwitchStatement.getHeadExprent();
      List<PooledConstant> bootstrapArguments = myPreviousSelector.getBootstrapArguments();
      Map<Integer, String> mapCaseClasses = getMapCaseClasses(bootstrapArguments);
      Map<Integer, Exprent> mapCaseValue = getMapCaseValue(bootstrapArguments);

      boolean hasPattern = remapCaseValues(mapCaseValue, mapCaseClasses);

      if (headExprent != null) {
        headExprent.replaceExprent(myPreviousSelector, myNewSwitchSelectorVariant);
      }
      if (hasPattern) {
        remapWithPatterns(myRootSwitchStatement, myPatternContainer, myUppedDoStatement, myTempVarAssignments);
        cleanDefault(myRootSwitchStatement);
      }
      Exprent oldSelector = myPreviousSelector.getInstance();
      if (oldSelector instanceof VarExprent oldSelectorVarExprent &&
          myNewSwitchSelectorVariant instanceof VarExprent newSwitchSelectorVarExprent) {
        changeEverywhere(oldSelectorVarExprent, newSwitchSelectorVarExprent, myRootSwitchStatement.getCaseStatements());
        changeDefaultToFullCase(myRootSwitchStatement, newSwitchSelectorVarExprent);
      }
    }
@Override
    public void simplify()