public static int translateLine(@Nullable Change change, int line, boolean approximate) {
    int result = line;

    Change currentChange = change;
    while (currentChange != null) {
      if (line < currentChange.line0) break;
      if (line >= currentChange.line0 + currentChange.deleted) {
        result += currentChange.inserted - currentChange.deleted;
      } else {
        return approximate ? currentChange.line1 : -1;
      }

      currentChange = currentChange.link;
    }

    return result;
  }
public static int translateLine(@Nullable Change change, int line, boolean approximate)