@Override
 public int hashCode() {
   int result = characters.hashCode();
   result = 31 * result + color.hashCode();
   result = 31 * result + style.hashCode();
   return result;
 }
  public boolean equalsIgnoreCharacter(TerminalString that) {
    if (style != that.style) return false;
    if (ignoreRendering != that.ignoreRendering) return false;
    if (!color.equals(that.color)) return false;

    return true;
  }
 public int getANSILength() {
   if (ignoreRendering) return 0;
   else {
     if (ansiLength == 0)
       ansiLength =
           ANSI.getStart().length()
               + color.getLength()
               + style.getLength()
               + ANSI.reset().length()
               + 2; // ; + m
     return ansiLength;
   }
 }
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof TerminalString)) return false;

    TerminalString that = (TerminalString) o;

    if (ignoreRendering) {
      return characters.equals(that.characters);
    }

    if (!characters.equals(that.characters)) return false;
    if (!color.equals(that.color)) return false;
    if (style != that.style) return false;

    return true;
  }