public static String getPackage(@NotNull PsiDirectory directory) {
      final VirtualFile virtualFile = directory.getVirtualFile();
      final Project project = directory.getProject();
      return PackageIndex.getInstance(project).getPackageNameByDirectory(virtualFile);
    }
public static String getPackage(@NotNull PsiDirectory directory)