public void add(int index, MatterInterval element) {
        if (index < 1 && fictitiousRegionReady) {
            throw new IndexOutOfBoundsException("Index must be from 1 to " + intervals.size() + " to add to MatterStack, but "
                    + index + " inserted");
        }
        processBack();
        intervals.add(index, element);
        if (!fictitiousRegionReady) {
            addFictitiousInterval();
        }
        process();
    }