public Object set(int index, Object obj) { int size = check(index); ListElement el = getElement(index); if (el == null) { if (obj != null) { create(index, obj); } return null; } else { Object result = ssn().get(el, m_element); if (obj == null && el.getIndex().intValue() < size - 1) { ssn().delete(el); } else { ssn().set(el, m_element, obj); } return result;
public Object set(int index, Object element) {  final Integer idx = new Integer(index); Object previous = elements.put(idx, element); if (previous == null) { elements.remove(idx); throw new IndexOutOfBoundsException(String.valueOf(index));
    public Object set(int index, Object obj) {        int size = check(index);        ListElement el = getElement(index);        if (el == null) {            if (obj != null) {                create(index, obj);            }            return null;        } else {            Object result = ssn().get(el, m_element);            if (obj == null && el.getIndex().intValue() < size - 1) {                ssn().delete(el);            } else {                ssn().set(el, m_element, obj);            }            return result;        }    }