void (@NotNull Runnable configureOptions, @NotNull Consumer<CodeStyleManager> reformat) { String testName = getTestName(true); int split = testName.indexOf('_'); String source = split != -1 ? testName.substring(0, split) : testName; String resultName = testName.replace('_', '.'); myFixture.configureByFile(source + ".yml"); configureOptions.run(); WriteCommandAction.runWriteCommandAction(null, () -> { CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(myFixture.getProject()); reformat.accept(codeStyleManager); }); myFixture.checkResultByFile(resultName + ".txt"); }