public static boolean hasPackageWithDirectories(JavaPsiFacade facade, String packageQName, GlobalSearchScope globalSearchScope) {
    return ReadAction.nonBlocking(() -> {
      PsiPackage aPackage = facade.findPackage(packageQName);
      return aPackage != null && aPackage.getDirectories(globalSearchScope).length > 0;
    }).executeSynchronously();
  }
public static boolean hasPackageWithDirectories(JavaPsiFacade facade, String packageQName, GlobalSearchScope globalSearchScope)