private static boolean isInExportedPackage(@Nullable RefClass refClass, @NotNull RefJavaModule refJavaModule) {
    RefEntity refOwner = refClass;
    final List<String> accessModifiers = List.of(PsiModifier.PUBLIC, PsiModifier.PROTECTED);
    while (refOwner instanceof RefClass clazz) {
      refOwner = accessModifiers.contains(clazz.getAccessModifier()) ? clazz.getOwner() : null;
    }
    if (refOwner instanceof RefPackage) {
      Map<String, List<String>> exportedPackageNames = refJavaModule.getExportedPackageNames();
      if (exportedPackageNames.containsKey(refOwner.getQualifiedName())) {
        return true;
      }
    }
    return false;
  }
private static boolean isInExportedPackage(@Nullable RefClass refClass, @NotNull RefJavaModule refJavaModule)