@VisibleForTesting
  static List<String> truncateToMaxWidth(List<String> lines) {
    List<String> truncatedLines = new ArrayList<>();
    for (String line : lines) {
      if (line.length() > MAX_FOOTER_WIDTH) {
        truncatedLines.add(line.substring(0, MAX_FOOTER_WIDTH - 3) + "...");
      } else {
        truncatedLines.add(line);
      }
    }
    return truncatedLines;
  }
@Test
  public void testTruncateToMaxWidth() {
    List<String> lines =
        Arrays.asList(
            "this line of text is way too long and will be truncated",
            "this line will not be truncated");
    Assert.assertEquals(
        Arrays.asList(
            "this line of text is way too long and will be t...",
            "this line will not be truncated"),
        AnsiLoggerWithFooter.truncateToMaxWidth(lines));
  }