private void checkArg(DiskRangeList other) {
    if (other == this) {
      // The only case where duplicate elements matter... the others are handled by the below.
      throw new AssertionError("Inserting self into the list [" + other + "]");
    }
    if (other.prev != null || other.next != null) {
      throw new AssertionError("[" + other + "] is part of another list; prev ["
          + other.prev + "], next [" + other.next + "]");
    }
  }
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