private static boolean isPackage(PsiElement element) {
    return element instanceof PsiDirectoryContainer && element.getContainingFile() == null;
  }
private static boolean isPackage(PsiElement element)