void () { final VirtualFile sourceRootDir = configureByFiles(null, getTestName(false) + ".java"); IntentionAction intentionAction = getIntentionAction(); assertNull(intentionAction); final Ref<VirtualFile> fileRef = new Ref<>(); ApplicationManager.getApplication().runWriteAction(() -> { try { VirtualFile file = sourceRootDir.createChildData(this, "sample.fxml"); VfsUtil.saveText(file, "<?import javafx.scene.layout.VBox?>\n<VBox/>"); fileRef.set(file); } catch (IOException e) { fail(e.toString()); } }); intentionAction = getIntentionAction(); assertNotNull("when created", intentionAction); ApplicationManager.getApplication().runWriteAction(() -> { try { fileRef.get().delete(this); } catch (IOException e) { fail(e.toString()); } }); intentionAction = getIntentionAction(); assertNull("when deleted", intentionAction); }