void (final boolean reformatText, final String filePath, final String fileExtension) { myFixture.configureByFile(filePath + getTestName(true) + fileExtension); WriteCommandAction.runWriteCommandAction(null, () -> { CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(myFixture.getProject()); PsiFile file = myFixture.getFile(); if (reformatText) { codeStyleManager.reformatText(file, 0, file.getTextLength()); } else { codeStyleManager.reformat(file); } }); myFixture.checkResultByFile(filePath + getTestName(true) + "_after" + fileExtension); }