code: public boolean isNewLine(String line, int index) {
          return index > lastIndex || (index == lastIndex && !Objects.equals(line, lastLine));
      }
docs: Returns true if this line index is newer than the last results
  or the last line has changed (e.g. if output was appended to the last line)