Attribute (final int index) { if (index < 0 || index >= size) { throw new IndexOutOfBoundsException("Index: " + index + " Size: " + size()); } final Attribute old = attributeData[index]; old.setParent(null); System.arraycopy(attributeData, index + 1, attributeData, index, size - index - 1); attributeData[--size] = null; // Let gc do its work modCount++; return old; }