@SuppressWarnings("unchecked")
    @Override
    public E get(int index) {
        if (index < 0 || index >= size) {
            throw new IndexOutOfBoundsException("Index " + index + "for size "
                    + size + " is out of bounds");
        }

        return (E) data[index];
    }