void (@NotNull RootStatement root) { List<SwitchOnCandidate> candidates = new ArrayList<>(); collectSwitchesOn(root, new ArrayList<>( Arrays.asList(new StringSwitchRecognizer.JavacStringRecognizer(), new StringSwitchRecognizer.EcjStringRecognizer(), new SwitchPatternHelper.JavacReferenceRecognizer() )), candidates, new HashSet<>()); if (candidates.isEmpty()) return; List<TempVarAssignmentItem> tempVarAssignments = new ArrayList<>(); candidates.forEach(candidate -> tempVarAssignments.addAll(candidate.prepareTempAssignments())); if (!checkAssignmentsToDelete(root, tempVarAssignments)) { return; } candidates.forEach(candidate -> candidate.simplify()); removeTempVariableDeclarations(tempVarAssignments); }