PsiDirectory (@NotNull String name, @NotNull String templateName) { if (templateName.equals(ORDINARY_PACKAGE_TYPE)) { createNewPackage(name, newOrdinaryPackageHandler, item -> { if (item != null) { view.selectElement(item); } }); } else if (templateName.equals(NAMESPACE_PACKAGE_TYPE)) { createNewPackage(name, newNamespacePackageHandler, item -> { if (item != null) { view.selectElement(item); } }); PyNamespacePackagesStatisticsCollector.logNamespacePackageCreatedByUser(); } return directory; }