### Question:
AnsiLoggerWithFooter implements ConsoleLogger { @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; } AnsiLoggerWithFooter(
      ImmutableMap<Level, Consumer<String>> messageConsumers,
      SingleThreadedExecutor singleThreadedExecutor,
      boolean enableTwoCursorUpJump); @Override void log(Level logLevel, String message); @Override void setFooter(List<String> newFooterLines);  }### Answer:
@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)); }