Project (@NotNull Path path, @NotNull Disposable parent) { Project project = Objects.requireNonNull(ProjectManagerEx.getInstanceEx().openProject(path, new OpenProjectTaskBuilder().build())); Disposer.register(parent, () -> forceCloseProjectWithoutSaving(project)); return project; }