code: public TextCharacter withModifier(SGR modifier) {
          if(modifiers.contains(modifier)) {
              return this;
          }
          EnumSet<SGR> newSet = EnumSet.copyOf(this.modifiers);
          newSet.add(modifier);
          return new TextCharacter(character, foregroundColor, backgroundColor, newSet);
      }
docs: Returns a copy of this TextCharacter with an additional SGR modifier. All of the currently active SGR codes
  will be carried over to the copy, in addition to the one specified.
  @param modifier SGR modifiers the copy should have in additional to all currently present
  @return Copy of the TextCharacter with a new SGR modifier