long remove(final long recordingId)
    {
        ensurePositive(recordingId, "recordingId");

        final long[] index = this.index;
        final int lastPosition = lastPosition();
        final int position = find(index, recordingId, lastPosition);
        if (position < 0)
        {
            return NULL_VALUE;
        }

        final long recordingDescriptorOffset = index[position + 1];

        count--;

        // Shift data to the left
        for (int i = position; i < lastPosition; i += 2)
        {
            index[i] = index[i + 2];
            index[i + 1] = index[i + 3];
        }
        // Reset last copied element
        index[lastPosition] = 0;
        index[lastPosition + 1] = 0;

        return recordingDescriptorOffset;
    }
@Test
    void removeReturnsNullValueWhenIndexIsEmpty()
    {
        assertEquals(NULL_VALUE, catalogIndex.remove(1));
    }