@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;
  }
Makes sure each line of text in {@code lines} is at most {@link #MAX_FOOTER_WIDTH} characters
long. If a line of text exceeds {@link #MAX_FOOTER_WIDTH} characters, the line is truncated to
{@link #MAX_FOOTER_WIDTH} characters with the last 3 characters as {@code ...}.

@param lines the lines of text
@return the truncated lines of text
jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/logging/AnsiLoggerWithFooter.java