public DiskRangeList replaceSelfWith(DiskRangeList other) {
    checkArg(other);
    other.prev = this.prev;
    other.next = this.next;
    if (this.prev != null) {
      checkOrder(this.prev, other, this);
      this.prev.next = other;
    }
    if (this.next != null) {
      checkOrder(other, this.next, this);
      this.next.prev = other;
    }
    this.next = this.prev = null;
    return other;
  }
Replaces this element with another in the list; returns the new element.
@param other the disk range to swap into this list
@return the new element
storage-api/src/java/org/apache/hadoop/hive/common/io/DiskRangeList.java