public static boolean isPackage(@NotNull PsiDirectory directory, @Nullable PsiElement anchor) {
    return isPackage(directory, true, anchor);
  }
public static boolean isPackage(@NotNull PsiDirectory directory, @Nullable PsiElement anchor)