void () { doTest(new MockIntroduceVariableHandler("wrong", false, false, false, JAVA_LANG_STRING) { @Override protected void assertValidationResult(boolean validationResult) { assertFalse(validationResult); } @Override protected void showErrorMessage(Project project, Editor editor, String message) { assertEquals("Introducing variable may break code logic<br>Local variable <b><code>c</code></b> is modified in loop body", message); } }); }