private static boolean hasClassesWithUnclosedBraces(@Nullable PsiFile psiFile) {
    PsiJavaFile javaFile = tryCast(psiFile, PsiJavaFile.class);
    return javaFile == null || ContainerUtil.exists(javaFile.getClasses(), c -> c.getRBrace() == null);
  }
private static boolean hasClassesWithUnclosedBraces(@Nullable PsiFile psiFile)