void (@NotNull Project project, @NotNull PsiDirectory directory, @NotNull Consumer<? super PsiElement[]> elementsConsumer) { MyInputValidator validator = new MyValidator(project, directory); if (ApplicationManager.getApplication().isUnitTestMode()) { try { elementsConsumer.accept(validator.create("test")); } catch (Exception e) { throw new RuntimeException(e); } } else { if (Experiments.getInstance().isFeatureEnabled("show.create.new.element.in.popup")) { createLightWeightPopup(validator, elementsConsumer).showCenteredInCurrentWindow(project); } else { Messages.showInputDialog(project, IdeBundle.message("prompt.enter.new.file.name"), IdeBundle.message("title.new.file"), null, null, validator); elementsConsumer.accept(validator.getCreatedElements()); } } }