private static boolean processPackageDeclarations(@NotNull ResolveState state,
                                                    @NotNull PsiElement place,
                                                    @NotNull PsiPackage aPackage,
                                                    @NotNull PsiScopeProcessor processor) {
    if (!aPackage.getQualifiedName().isEmpty()) {
      processor = new DelegatingScopeProcessor(processor) {
        @Override
        public @Nullable <T> T getHint(@NotNull Key<T> hintKey) {
          if (hintKey == ElementClassHint.KEY) {
            //noinspection unchecked
            return (T)(ElementClassHint)kind -> kind == ElementClassHint.DeclarationKind.CLASS;
          }
          return super.getHint(hintKey);
        }
      };
    }
    return aPackage.processDeclarations(processor, state, null, place);
  }
private static boolean processPackageDeclarations(@NotNull ResolveState state,
                                                    @NotNull PsiElement place,
                                                    @NotNull PsiPackage aPackage,
                                                    @NotNull PsiScopeProcessor processor)