public static boolean canHaveBom(@NotNull Charset charset, byte @NotNull [] bom) {
    return charset.equals(StandardCharsets.UTF_8) && Arrays.equals(bom, UTF8_BOM) || Arrays.equals(getMandatoryBom(charset), bom);
  }
public static boolean canHaveBom(@NotNull Charset charset, byte @NotNull [] bom)