public Object set(int index, Object element) {
    synchronized (lock) {
      rangeCheck(index);

      Object oldValue = elementData[index];
      elementData[index] = element;
      return oldValue;
    }
  }
Replaces the element at the specified position in this list with the specified element.

@param index index of the element to replace
@param element element to be stored at the specified position
@return the element previously at the specified position
geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexElemArray.java