private static String getPackageName(@NotNull VirtualFile file, @NotNull Project project) {
    VirtualFile dir = file.isDirectory() ? file : file.getParent();
    if (dir == null) return null;
    return StringUtil.getQualifiedName(PackageIndex.getInstance(project).getPackageNameByDirectory(dir), file.getNameWithoutExtension());
  }
private static String getPackageName(@NotNull VirtualFile file, @NotNull Project project)