public static boolean isRoot(PsiFileSystemItem directory) {
    if (directory == null) return true;
    VirtualFile vFile = directory.getVirtualFile();
    if (vFile == null) return true;
    Project project = directory.getProject();
    return isRoot(vFile, project);
  }
public static boolean isRoot(PsiFileSystemItem directory)