void (@NonNls String code) { myFixture.enableInspections(new UnexpectedAnchorInspection()); myFixture.configureByText(JavaFileType.INSTANCE, "class X {" + " void test(boolean c) {" + " java.util.regex.Pattern.compile(" + code + ");" + " }" + " String getStr() {" + " return \"\";" + " }" + "}"); myFixture.testHighlighting(); }