Project () { try { myCreatedProject = NewProjectUtil.createFromWizard(myWizard); } catch (Throwable e) { myCreatedProject = ContainerUtil.find(ProjectManager.getInstance().getOpenProjects(), project -> { return myWizard.getProjectName().equals(project.getName()); }); throw new RuntimeException(e); } assertNotNull(myCreatedProject); UIUtil.dispatchAllInvocationEvents(); return myCreatedProject; }