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);
}

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 ) ; }
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 .
