void () { myFixture.setCaresAboutInjection(false); myFixture.configureByText("Test.java", """ import java.util.regex.Pattern; class Test { Pattern p = Pattern.compile("[\\"123<caret>1]"); }"""); myFixture.enableInspections(new DuplicateCharacterInClassInspection()); IntentionAction action = myFixture.findSingleIntention("Remove duplicate '1' from character class"); assertEquals(""" import java.util.regex.Pattern; class Test { Pattern p = Pattern.compile("[\\"123]"); }""", myFixture.getIntentionPreviewText(action)); }