private void mergeLast(long lowerBound, long upperBound) {
      if (getIntervalSize() == 0) {
        addInterval(lowerBound, upperBound);
        return;
      }
      int lastIndex = getIntervalSize() - 1;
      long lastLB = getLowerBound(lastIndex);
      long lastUB = getUpperBound(lastIndex);
      if (lowerBound > lastUB + 1) {
        // e.g., last [3, 5], new [7, 10], just add the new interval
        addInterval(lowerBound, upperBound);
        return;
      }
      if (upperBound < lastLB - 1) {
        // e.g., last [7, 10], new [3, 5], do nothing
        return;
      }
      // merge the new interval into the last one
      setLowerBound(lastIndex, Math.min(lastLB, lowerBound));
      setUpperBound(lastIndex, Math.max(lastUB, upperBound));
    }
Merge an interval of [lowerBound, upperBound] with the last interval if they can be merged,
or just add it as the last interval if its lowerBound is larger than the upperBound of the
last interval. If the upperBound of the new interval is less than the lowerBound of the last
interval, nothing will be done.

@param lowerBound
@param upperBound
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/TimeValuePairUtils.java