void (final String testName, final String hint) { myFixture.configureByFile(getRelativePath() + "/" + testName + ".java"); IntentionAction action = myFixture.getAvailableIntention(hint); if (action == null) { fail("No action '"+hint+"' found among "+ StreamEx.of(myFixture.getAvailableIntentions()).map(IntentionAction::getText).joining(", ")); } assertNotNull(action); Path previewPath = Path.of(myFixture.getTestDataPath(), getRelativePath(), testName + ".preview.java"); if (Files.exists(previewPath)) { String previewText = myFixture.getIntentionPreviewText(action); assertSameLinesWithFile(previewPath.toString(), previewText); myFixture.launchAction(action); } else { myFixture.checkPreviewAndLaunchAction(action); } NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); myFixture.checkResultByFile(getRelativePath() + "/" + testName + ".after.java"); }