/**
   * Shortens the value of the given label client.
   *
   * @param client the label to shorten
   * @param maxChar the length of the new label value
   */
  public static void shortenLabel(LabelShortenerClient client, int maxChar) {
    String originalValue = client.getOriginalValue();
    String value =
        originalValue.length() > maxChar
            ? (originalValue.substring(0, maxChar - 1) + "…")
            : originalValue;

    client.setValue(value);
  }
 /**
  * Reverts the original value of the given label.
  *
  * @param client the label to revert the original value
  */
 public static void revertLabel(LabelShortenerClient client) {
   client.revertOriginalValue();
 }