@NotNull
  public String computeAnsiSerializedSGRState() {
    List<String> state = new ArrayList<>();
    IntConsumer codeConsumer = it -> state.add(Integer.toString(it));

    codeConsumer.accept(SGR_COMMAND_RESET);
    if (myFont != TerminalFont.DEFAULT) {
      codeConsumer.accept(myFont.sgrCode);
    }
    if (myWeight != Weight.DEFAULT) {
      codeConsumer.accept(myWeight.sgrCode);
    }
    if (myUnderline != Underline.DEFAULT) {
      codeConsumer.accept(myUnderline.sgrCode);
    }
    if (myFont != TerminalFont.DEFAULT) {
      codeConsumer.accept(myFont.sgrCode);
    }
    if (myBlink != BlinkSpeed.DEFAULT) {
      codeConsumer.accept(myBlink.sgrCode);
    }
    if (myIsInverse) {
      codeConsumer.accept(SGR_COMMAND_INVERSE);
    }
    if (myBackgroundColor != null) {
      codeConsumer.accept(SGR_COMMAND_BG_COLOR_ENCODED);
      state.add(myBackgroundColor.getAnsiEncodedColor());
    }
    if (myForegroundColor != null) {
      codeConsumer.accept(SGR_COMMAND_FG_COLOR_ENCODED);
      state.add(myForegroundColor.getAnsiEncodedColor());
    }
    if (myIsItalic) {
      codeConsumer.accept(SGR_COMMAND_ITALIC);
    }
    if (myIsConseal) {
      codeConsumer.accept(SGR_COMMAND_CONCEAL);
    }
    if (myIsCrossedOut) {
      codeConsumer.accept(SGR_COMMAND_CROSS_OUT);
    }
    if (myIsFraktur) {
      codeConsumer.accept(SGR_COMMAND_FRAKTUR);
    }
    if (myFrameType != FrameType.DEFAULT) {
      codeConsumer.accept(myFrameType.sgrCode);
    }
    if (myIsOverlined) {
      codeConsumer.accept(SGR_COMMAND_OVERLINED);
    }
    return AnsiStreamingLexer.CSI + StringUtil.join(state, ";") + SGR_SUFFIX;
  }
@NotNull
  public String computeAnsiSerializedSGRState()