docs: public void update(int offset, List<String> lines) {
          if (lines.isEmpty()) {
              throw new IllegalArgumentException("Empty line set");
          }
          if (offset >= count() || offset < 0) {
              throw new IndexOutOfBoundsException("Index: " + offset + ", Size: " + count());
          }
  
          int up = count() - offset - 1;
          for (int i = 0; i < lines.size(); ++i) {
              String line = lines.get(i);
              if (i == 0) {
                  terminal.print("\r");
                  if (up > 0) {
                      terminal.print(cursorUp(up));
                  }
              } else {
                  terminal.println();
                  --up;
              }
  
              String old = offset + i < buffer.size()
                           ? buffer.get(offset + i)
                           : null;
              buffer.set(offset + i, line);
              if (line.equals(old) && !line.isEmpty()) {
                  // No change.
                  continue;
              }
              terminal.print(CURSOR_ERASE);
              terminal.print(line);
          }
  
          // Move the cursor back to the end of the last line.
          if (up > 0) {
              terminal.format("\r%s%s",
                              cursorDown(up),
                              cursorRight(printableWidth(lastLine())));
          }
  
      }