private static boolean isBOMMandatory(@NotNull VirtualFile file) {
    return CharsetToolkit.getMandatoryBom(file.getCharset()) != null;
  }
private static boolean isBOMMandatory(@NotNull VirtualFile file)