private static LocalQuickFix @NotNull [] getFixes(@NotNull PsiFile file,
                                                    @NotNull VirtualFile virtualFile,
                                                    @NotNull Charset wrongCharset) {
    Set<Charset> suspects = ContainerUtil.newHashSet(CharsetToolkit.getDefaultSystemCharset(), CharsetToolkit.getPlatformCharset());
    suspects.remove(wrongCharset);
    List<Charset> goodCharsets = ContainerUtil.filter(suspects, c -> isGoodCharset(virtualFile, c));
    List<LocalQuickFix> fixes = new ArrayList<>();
    if (!goodCharsets.isEmpty()) {
      Charset goodCharset = goodCharsets.get(0);
      fixes.add(new LocalQuickFix() {
        @Nls
        @NotNull
        @Override
        public String getFamilyName() {
          return InspectionsBundle.message("reload.file.encoding.family.name", goodCharset.displayName());
        }

        @Override
        public boolean startInWriteAction() {
          return false;
        }

        @Override
        public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
          Document document = PsiDocumentManager.getInstance(project).getDocument(file);
          if (document == null) {
            return;
          }
          ChangeFileEncodingAction.changeTo(project, document, null, virtualFile, goodCharset, EncodingUtil.Magic8.ABSOLUTELY, EncodingUtil.Magic8.ABSOLUTELY);
        }
      });
      fixes.add(new LocalQuickFix() {
        @Nls
        @NotNull
        @Override
        public String getFamilyName() {
          return InspectionsBundle.message("set.project.encoding.family.name", goodCharset.displayName());
        }

        @Override
        public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
          EncodingProjectManager.getInstance(project).setDefaultCharsetName(goodCharset.name());
        }
      });
    }
    fixes.add(new ReloadInAnotherEncodingFix(file));
    return fixes.toArray(LocalQuickFix.EMPTY_ARRAY);
  }
private static LocalQuickFix @NotNull [] getFixes(@NotNull PsiFile file,
                                                    @NotNull VirtualFile virtualFile,
                                                    @NotNull Charset wrongCharset)