public int set(int index, int value) { checkIndex(index, 0, size-1); elementData[index] = value; return value; }