* @return Whether, given the two undo patches, they should be merged
   *         instead of pushing the new one.
   * @note It is immaterial which UndoPatch is newer.
   */
  private static boolean undoCompatible(UndoPatch up1, UndoPatch up2) {
    if ((up1.opTag != up2.opTag && up2.opTag != OPT.SPACE) || up1.startRow != up2.startRow) {
      return false;
    }
    if (up1.oldText.length != up1.patchText.length || up1.oldText.length != up2.oldText.length
        || up2.patchText.length != up2.patchText.length) {
      return false;
    }
    return true;
  }