public static boolean isAcceptableInContext(final @NotNull PsiElement context,
                                              final @NotNull PsiClass psiClass,
                                              final boolean filterByScope, final boolean pkgContext) {
    ProgressManager.checkCanceled();

    if (JavaCompletionUtil.isInExcludedPackage(psiClass, false)) return false;

    final String qualifiedName = psiClass.getQualifiedName();
    if (qualifiedName == null) return false;

    if (!filterByScope && !(psiClass instanceof PsiCompiledElement)) return true;

    return JavaCompletionUtil.isSourceLevelAccessible(context, psiClass, pkgContext);
  }
public static boolean isAcceptableInContext(final @NotNull PsiElement context,
                                              final @NotNull PsiClass psiClass,
                                              final boolean filterByScope, final boolean pkgContext)