private static void createNewPackage(@NotNull String name,
                                       @NotNull CreateDirectoryOrPackageHandler createHandler,
                                       @NotNull Consumer<? super PsiFileSystemItem> consumer) {
    if (createHandler.checkInput(name) && createHandler.canClose(name)) {
      consumer.accept(createHandler.getCreatedElement());
    }
    else {
      String errorMessage = createHandler.getErrorText(name);
      Messages.showErrorDialog(errorMessage, PyBundle.message("dialog.title.can.t.create.package"));
    }
  }
private static void createNewPackage(@NotNull String name,
                                       @NotNull CreateDirectoryOrPackageHandler createHandler,
                                       @NotNull Consumer<? super PsiFileSystemItem> consumer)