@Override
  public synchronized E set(int index, E element) {
    ArrayList<E> newList = new ArrayList<>(list);
    E result = newList.set(index, element);
    Collections.sort(list, comparator);
    list = Collections.unmodifiableList(newList);
    return result;
  }
Returns a reference to the unmodifiable list currently backing the SortedList. Changes to the
SortedList will not be reflected in this list. Use this method to get a reference for iterating
over using the RandomAccess pattern.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/SortedList.java