void add(final long recordingId, final long recordingDescriptorOffset)
    {
        ensurePositive(recordingId, "recordingId");
        ensurePositive(recordingDescriptorOffset, "recordingDescriptorOffset");

        final int nextPosition = count << 1;
        long[] index = this.index;
        if (nextPosition > 0)
        {
            if (recordingId <= index[nextPosition - 2])
            {
                throw new IllegalArgumentException("recordingId " + recordingId +
                    " is less than or equal to the last recordingId " + index[nextPosition - 2]);
            }
            if (nextPosition == index.length)
            {
                index = expand(index);
                this.index = index;
            }
        }
        index[nextPosition] = recordingId;
        index[nextPosition + 1] = recordingDescriptorOffset;

        count++;
    }
@Test
    void addThrowsIllegalArgumentExceptionIfRecordingIdIsNegative()
    {
        assertThrows(IllegalArgumentException.class, () -> catalogIndex.add(-1, 0));
    }