docs: def _read_next(cls, lines: List[str]) -> 'Hunk':
          """
          Constructs a hunk from a supplied fragment of a unified format diff.
          """
          header = lines[0]
          assert header.startswith('@@ -')
  
          # sometimes the first line can occur on the same line as the header.
          # in that case, we inject a new line into the buffer
          end_header_at = header.index(' @@')
          bonus_line = header[end_header_at+3:]
          if bonus_line != "":
              lines.insert(1, bonus_line)
  
          header = header[4:end_header_at]
          left, _, right = header.partition(' +')
          old_start_at = int(left.split(',')[0])
          new_start_at = int(right.split(',')[0])
  
          old_line_num = old_start_at
          new_line_num = new_start_at
          last_insertion_at = old_start_at
  
  
          hunk_lines = [] # type: List[HunkLine]
          while True:
              # discarding the previous line ensures that we only consume lines
              # from the line buffer that belong to the hunk
              lines.pop(0)
              if not lines:
                  break
  
              line = lines[0]
  
              # inserted line
              if line.startswith('+'):
                  hunk_lines.append(InsertedLine(line[1:]))
                  new_line_num += 1
  
              # deleted line
              elif line.startswith('-'):
                  hunk_lines.append(DeletedLine(line[1:]))
                  old_line_num += 1
  
              # context line
              elif line.startswith(' '):
                  hunk_lines.append(ContextLine(line[1:]))
                  new_line_num += 1
                  old_line_num += 1
  
              # end of hunk
              else:
                  break
  
          return Hunk(old_start_at, new_start_at, hunk_lines)